Fix an uninitialized-memory bug.

Fix an uninitialized-memory bug.

Swift SVN r2852

--- lib/IRGen/GenSequential.h
+++ lib/IRGen/GenSequential.h
@@ -288,6 +288,9 @@
     assert(astFields.size() == SeqTI->NumFields);

     if (astFields.empty()) {
+      SeqTI->setPOD(IsPOD);
+      SeqTI->MaximalExplosionSize = 0;
+      SeqTI->MinimalExplosionSize = 0;
       asImpl()->completeEmpty(SeqTI);
       return SeqTI;
     }


* subversion/libsvn_ra_serf/mergeinfo.c
  (svn_ra_serf__get_mergeinfo): Add localization of error message.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@868245 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_ra_serf/mergeinfo.c
+++ subversion/libsvn_ra_serf/mergeinfo.c
@@ -281,7 +281,7 @@
     {
       svn_error_clear(err);
       return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL,
-                               "'%s' path not found", handler->path);
+                               _("'%s' path not found"), handler->path);
     }

   /* If the server responds with HTTP_NOT_IMPLEMENTED (which ra_serf


whoops

whoops

Signed-off-by: Mattias Andrée <3d72f033b30d63e7ff5f0b71398e9c45b66386a1@operamail.com>

--- src/cmdline.c
+++ src/cmdline.c
@@ -20,10 +20,10 @@

 #define S 0
-#define P 0
-#define Q 1
-
-#define SEMAPHORES 2
+#define P 1
+#define Q 2
+
+#define SEMAPHORES 3
 #define MEMORY_SIZE (2 * 1024)


* subversion/libsvn_wc/old-and-busted.c   (take_from_entry): Stop using the deprecated svn_path_url_add_component     function.

--- subversion/libsvn_wc/old-and-busted.c
+++ subversion/libsvn_wc/old-and-busted.c
@@ -801,7 +801,7 @@

   /* Inherits parent's url if doesn't have a url of one's own. */
   if (! dst->url)
-    dst->url = svn_path_url_add_component(src->url, dst->name, pool);
+    dst->url = svn_path_url_add_component2(src->url, dst->name, pool);

   if (! dst->repos)
     dst->repos = src->repos;


varg + operator

varg + operator

--- src/codegen.c
+++ src/codegen.c
@@ -407,12 +407,37 @@
 	irep->clen++;
 	break;
       }
+
+#define ARGC_ASSERT_GE(n) do {				\
+	if (pic_length(pic, obj) < (n) + 1) {		\
+	  pic_error(pic, "wrong number of arguments");	\
+	}						\
+      } while (0)
+
       else if (sym == pic->sADD) {
-	ARGC_ASSERT(2);
-	codegen(state, pic_car(pic, pic_cdr(pic, obj)), false);
-	codegen(state, pic_car(pic, pic_cdr(pic, pic_cdr(pic, obj))), false);
-	irep->code[irep->clen].insn = OP_ADD;
-	irep->clen++;
+	pic_value args;
+
+	ARGC_ASSERT_GE(0);
+	switch (pic_length(pic, obj)) {
+	case 1:
+	  irep->code[irep->clen].insn = OP_PUSHINT;
+	  irep->code[irep->clen].u.i = 0;
+	  irep->clen++;
+	  break;
+	case 2:
+	  codegen(state, pic_car(pic, pic_cdr(pic, obj)), tailpos);
+	  break;
+	default:
+	  args = pic_cdr(pic, obj);
+	  codegen(state, pic_car(pic, args), false);
+	  while (pic_length(pic, args) >= 2) {
+	    codegen(state, pic_car(pic, pic_cdr(pic, args)), false);
+	    irep->code[irep->clen].insn = OP_ADD;
+	    irep->clen++;
+	    args = pic_cdr(pic, args);
+	  }
+	  break;
+	}
 	break;
       }
       else if (sym == pic->sSUB) {


resolve TODOs

resolve TODOs

--- src/codegen.c
+++ src/codegen.c
@@ -700,7 +700,8 @@
 static void
 destroy_resolver_state(resolver_state *state)
 {
-  /* TODO */
+  pop_resolver_scope(state);
+  pic_free(state->pic, state);
 }

 static void
@@ -748,8 +749,15 @@
 static void
 pop_resolver_scope(resolver_state *state)
 {
-  /* FIXME */
-  state->scope = state->scope->up;
+  resolver_scope *scope;
+
+  scope = state->scope;
+  xh_destory(scope->cvs);
+  xh_destory(scope->lvs);
+
+  scope = scope->up;
+  pic_free(state->pic, state->scope);
+  state->scope = scope;
 }

 static bool
@@ -1049,10 +1057,6 @@
   pic_state *pic = state->pic;
   codegen_context *cxt = state->cxt;
   pic_sym sym;
-
-  printf("generating... ");
-  pic_debug(pic, obj);
-  puts("");

   sym = pic_sym(pic_car(pic, obj));
   if (sym == state->sGREF) {


... beginning of the chaining example code.

Monty

git-svn-id: 03f0f1727258f1959b7b485b30a676bafdb78148@155 0101bb08-14d6-0310-b084-bc0e0c8e3800

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

--- lib/chaining_example.c
+++ lib/chaining_example.c
@@ -0,0 +1,49 @@
+/********************************************************************
+ *                                                                  *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
+ * PLEASE READ THESE TERMS DISTRIBUTING.                            *
+ *                                                                  *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999             *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company       *
+ * http://www.xiph.org/                                             *
+ *                                                                  *
+ ********************************************************************
+
+ function: simple example of opening/seeking chained bitstreams
+ author: Monty <xiphmont@mit.edu>
+ modifications by: Monty
+ last modification date: Oct 29 1999
+
+ ********************************************************************/
+
+
+#include <stdio.h>
+#include <math.h>
+#include "codec.h"
+
+/* A 'chained bitstream' is a Vorbis bitstream that contains more than
+   one logical bitstream arranged end to end (the only form of Ogg
+   multiplexing allowed in a Vorbis bitstream; grouping [parallel
+   multiplexing] is not allowed in Vorbis) */
+
+/* A Vorbis file can be played beginning to end (streamed) without
+   worrying ahead of time about chaining.  If we have the whole file,
+   however, and want random access (seeking/scrubbing) or desire to
+   know the total length/time of a file, we need to account for the
+   possibility of chaining. */
+
+/* We can handle things a number of ways; we can determine the entire
+   bitstream structure right off the bat, or piece it together later.
+   This example determines and caches structure for the entire
+   bitstream, but builds a virtual decoder on the fly when moving from
+   one link of the chain to another */
+
+/* There are also different ways to implement seeking.  Enough
+   information exists in an Ogg bitstream to seek to
+   sample-granularity positions in the output.  Or, one can seek by
+   picking some portion of the stream roughtly in the area we only
+   want course navigation through the stream.  This example implements
+   the latter. */
+


Make QGCMapPolygon area accessible in QML

--- src/MissionManager/QGCMapPolygon.h
+++ src/MissionManager/QGCMapPolygon.h
@@ -32,6 +32,7 @@

     Q_PROPERTY(int                  count           READ count                                  NOTIFY countChanged)
     Q_PROPERTY(QVariantList         path            READ path                                   NOTIFY pathChanged)
+    Q_PROPERTY(double               area            READ area                                   NOTIFY pathChanged)
     Q_PROPERTY(QmlObjectListModel*  pathModel       READ qmlPathModel                           CONSTANT)
     Q_PROPERTY(bool                 dirty           READ dirty          WRITE setDirty          NOTIFY dirtyChanged)
     Q_PROPERTY(QGeoCoordinate       center          READ center         WRITE setCenter         NOTIFY centerChanged)


fix the precompiled redefinition problem

--- src/Mod/Assembly/Gui/PreCompiled.h
+++ src/Mod/Assembly/Gui/PreCompiled.h
@@ -21,8 +21,8 @@
  ***************************************************************************/

-#ifndef ASSEMGBLYGUI_PRECOMPILED_H
-#define ASSEMGBLYGUI_PRECOMPILED_H
+#ifndef ASSEMBLY_PRECOMPILED_H
+#define ASSEMBLY_PRECOMPILED_H

 #include <FCConfig.h>

@@ -41,8 +41,8 @@

 #ifdef _PreComp_
-
-// Python
+
+// Python
 #include <Python.h>

 // standard
@@ -72,7 +72,7 @@
 #ifndef __Qt4All__
 # include <Gui/Qt4All.h>
 #endif
-
+
 #endif //_PreComp_

 #endif // ASSEMGBLYGUI_PRECOMPILED_H


add <sys/linker.h>

add <sys/linker.h>

--- sys/boot/alpha/libalpha/elf_freebsd.c
+++ sys/boot/alpha/libalpha/elf_freebsd.c
@@ -1,4 +1,4 @@
-/* $Id: elf_freebsd.c,v 1.2 1998/08/31 21:10:40 msmith Exp $ */
+/* $Id: elf_freebsd.c,v 1.3 1998/09/14 18:27:00 msmith Exp $ */
 /* $NetBSD: loadfile.c,v 1.10 1998/06/25 06:45:46 ross Exp $ */

 /*-
@@ -80,6 +80,7 @@
 #include <string.h>

 #include <sys/param.h>
+#include <sys/linker.h>
 #include <machine/elf.h>
 #include <machine/prom.h>
 #include <machine/rpb.h>


sysinit - Fix custom panic function.

sysinit - Fix custom panic function.

There were two issues associated with specifying a custom panic function
in sysinit's syscfg:

1. The custom function never got used; the macro check to determine if a
custom function has been specified was wrong.

2. It was tedious to ensure a prototype for the custom panic function
had been declared wherever SYSINIT_PANIC() gets called.  Now, a
prototype is automatically declared by SYSINIT_PANIC().

--- sys/sysinit/include/sysinit/sysinit.h
+++ sys/sysinit/include/sysinit/sysinit.h
@@ -33,10 +33,11 @@

 typedef void sysinit_panic_fn(const char *file, int line);

-#if !MYNEWT_VAL(SYSINIT_PANIC_FN)
+#ifndef MYNEWT_VAL_SYSINIT_PANIC_FN
 #include <assert.h>
 #define SYSINIT_PANIC() assert(0)
 #else
+void MYNEWT_VAL(SYSINIT_PANIC_FN)(const char *file, int line);
 #define SYSINIT_PANIC() MYNEWT_VAL(SYSINIT_PANIC_FN)(__FILE__, __LINE__)
 #endif


Create fpu_dump.h

Create fpu_dump.h

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

--- fpu_dump.h
+++ fpu_dump.h
@@ -0,0 +1,270 @@
+/* fpu_dump.h -- x87 FPU state dumper
+version 0.1, September 12th, 2007
+
+Copyright (C) 2007 Jevin Sweval
+
+This software is provided 'as-is', without any express or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software
+in a product, an acknowledgment in the product documentation would be
+appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Jevin Sweval (jevinsweval @t gmail d0t com)
+
+*/
+
+/*                   HOWTO USE
+ *
+ * Simply include this file and call FPUDUMP from anywhere in your program.
+ * e.g.:
+ *
+ * #include "fpu_dump.h"
+ * // some code
+ * FPUDUMP;
+ * // more code
+ *
+ * For more detailed output, uncomment the FPU_DUMP_VERBOSE
+ *  define or define it in the compile line using '-DFPU_DUMP_VERBOSE'
+ *
+ * Credit goes to the excellent OllyDbg for the
+ *  consise and readable output format
+ */
+
+#ifndef FPU_DUMP_H_FILE
+#define FPU_DUMP_H_FILE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*#define FPU_DUMP_VERBOSE*/
+
+/* Call this from anywhere in your code (e.g. 'FPU_DUMP;') */
+/* Copies the FPU state into the struct, prints it, and restores it */
+#define FPU_DUMP                                         \
+   __asm__ volatile ("fsave %[fpu]\n\t"                  \
+                     : [fpu] "=m"(fpu.orig)              \
+                     : );                                \
+   fpu_dump(__FILE__, __LINE__);                         \
+   __asm__ volatile ("frstor %[fpu]\n\t"                 \
+                     :                                   \
+                     : [fpu] "m"(fpu.orig));
+
+/* struct for the FPU environment dumped by fsave */
+typedef struct {
+   unsigned short cont;
+   unsigned short padding1;
+   unsigned short stat;
+   unsigned short padding2;
+   unsigned short tag;
+   unsigned short padding3;
+   unsigned int   instr_off;
+   unsigned short instr_sel;
+   unsigned short opcode;
+   unsigned int   op_off;
+   unsigned short op_sel;
+   unsigned short padding4;
+   unsigned short regs[8][5];
+} FPU_ENV;
+
+/* struct for the parsed control word */
+typedef struct {
+   char           inv_mask;
+   char           denorm_mask;
+   char           zero_mask;
+   char           over_mask;
+   char           under_mask;
+   char           prec_mask;
+   short          prec;
+   char           rnd[5];
+   char           inf;
+} FPU_CONTROL;
+
+/* struct for the parsed status word */
+typedef struct {
+   char           inv;
+   char           denorm;
+   char           zero;
+   char           over;
+   char           under;
+   char           prec;
+   char           sf;
+   char           error;
+   char           c0;
+   char           c1;
+   unsigned short top;
+   char           c2;
+   char           c3;
+   char           busy;
+} FPU_STATUS;
+
+/* struct that contains the environment and parsed environment */
+typedef struct {
+   FPU_ENV        env;
+   FPU_ENV        orig;
+   FPU_CONTROL    cont;
+   FPU_STATUS     stat;
+   char           tags[8][7];
+   long double    regs[8];
+} FPU;
+
+FPU fpu;
+int fpu_i;
+
+void fpu_dump(char*, int);
+
+void fpu_dump(char* file, int line) {
+   /* Be extra careful to not modify the status */
+   fpu.env = fpu.orig;
+
+   /* Parse the control word */
+   fpu.cont.inv_mask =     (fpu.env.cont >> 0) & 0x1;
+   fpu.cont.denorm_mask =  (fpu.env.cont >> 1) & 0x1;
+   fpu.cont.zero_mask =    (fpu.env.cont >> 2) & 0x1;
+   fpu.cont.over_mask =    (fpu.env.cont >> 3) & 0x1;
+   fpu.cont.under_mask =   (fpu.env.cont >> 4) & 0x1;
+   fpu.cont.prec_mask =    (fpu.env.cont >> 5) & 0x1;
+   /* Parse the precision bits */
+   switch ((fpu.env.cont >> 8) & 0x3) {
+      case 0x0:
+         fpu.cont.prec = 24;
+         break;
+      case 0x1: /* reserved */
+         fpu.cont.prec = -1;
+         break;
+      case 0x2:
+         fpu.cont.prec = 53;
+         break;
+      case 0x3:
+         fpu.cont.prec = 64;
+         break;
+   }
+   /* Parse the rounding bits */
+   switch ((fpu.env.cont >> 10) & 0x3) {
+      case 0x0:
+         strcpy(fpu.cont.rnd, "NEAR");
+         break;
+      case 0x1:
+         strcpy(fpu.cont.rnd, "DOWN");
+         break;
+      case 0x2:
+         strcpy(fpu.cont.rnd, "UP");
+         break;
+      case 0x3:
+         strcpy(fpu.cont.rnd, "ZERO");
+         break;
+   }
+   fpu.cont.inf =          (fpu.env.cont >> 12) & 0x1;
+
+   /* Parse the status word */
+   fpu.stat.inv =    (fpu.env.stat >> 0) & 0x1;
+   fpu.stat.denorm = (fpu.env.stat >> 1) & 0x1;
+   fpu.stat.zero =   (fpu.env.stat >> 2) & 0x1;
+   fpu.stat.over =   (fpu.env.stat >> 3) & 0x1;
+   fpu.stat.under =  (fpu.env.stat >> 4) & 0x1;
+   fpu.stat.prec =   (fpu.env.stat >> 5) & 0x1;
+   fpu.stat.sf =     (fpu.env.stat >> 6) & 0x1;
+   fpu.stat.error =  (fpu.env.stat >> 7) & 0x1;
+   fpu.stat.c0 =     (fpu.env.stat >> 8) & 0x1;
+   fpu.stat.c1 =     (fpu.env.stat >> 9) & 0x1;
+   fpu.stat.c2 =     (fpu.env.stat >> 10) & 0x1;
+   fpu.stat.top =    (fpu.env.stat >> 11) & 0x7;
+   fpu.stat.c3 =     (fpu.env.stat >> 14) & 0x1;
+   fpu.stat.busy =   (fpu.env.stat >> 15) & 0x1;
+
+   /* Parse the tags for each data register */
+   for (fpu_i = 0; fpu_i < 8; fpu_i++) {
+      switch ((fpu.env.tag >> (2 * fpu_i)) & 0x3) {
+         case 0x0:
+            strcpy(fpu.tags[fpu_i], "VALID");
+            break;
+         case 0x1:
+            strcpy(fpu.tags[fpu_i], "ZERO");
+            break;
+         case 0x2:
+            strcpy(fpu.tags[fpu_i], "SPEC");
+            break;
+         case 0x3:
+            strcpy(fpu.tags[fpu_i], "EMPTY");
+            break;
+      }
+   }
+
+   /* Convert from FPU's 10 byte long doubles to GCC's 12 bytes */
+   for(fpu_i = 0; fpu_i < 8; fpu_i++) {
+      *((short*)&fpu.regs[fpu_i] + 0) = fpu.env.regs[fpu_i][0];
+      *((short*)&fpu.regs[fpu_i] + 1) = fpu.env.regs[fpu_i][1];
+      *((short*)&fpu.regs[fpu_i] + 2) = fpu.env.regs[fpu_i][2];
+      *((short*)&fpu.regs[fpu_i] + 3) = fpu.env.regs[fpu_i][3];
+      *((short*)&fpu.regs[fpu_i] + 4) = fpu.env.regs[fpu_i][4];
+      *((short*)&fpu.regs[fpu_i] + 5) = 0x0000;
+   }
+
+   printf("\n\n================== MAGICAL FPU INSPECTOR ==================\n");
+   printf("From %s line %d:\n", file, line);
+
+#ifdef FPU_DUMP_VERBOSE
+   /* Detailed status register */
+   printf("\nStatus: 0x%04X\n", fpu.env.stat);
+   printf("   Invalid: %d, Denorm: %d, Zero Div: %d\n", fpu.stat.inv, fpu.stat.denorm, fpu.stat.zero);
+   printf("   Overflow: %d, Underflow: %d, Precision: %d\n", fpu.stat.over, fpu.stat.under, fpu.stat.prec);
+   printf("   Stack fault: %d, Error summary: %d, TOP: %d\n", fpu.stat.sf, fpu.stat.error, fpu.stat.top);
+   printf("   C3: %d, C2: %d, C1: %d, C0: %d\n", fpu.stat.c3, fpu.stat.c2, fpu.stat.c1, fpu.stat.c0);
+
+   /* Detailed control register */
+   printf("\nControl: 0x%04X\n", fpu.env.cont);
+   printf("   Invalid Mask: %d, Denorm Mask: %d, Zero Div Mask: %d\n", fpu.cont.inv_mask, fpu.cont.denorm_mask, fpu.cont.zero_mask);
+   printf("   Overflow Mask: %d, Underflow Mask: %d, Precision Mask: %d\n", fpu.cont.over_mask, fpu.cont.under_mask, fpu.cont.prec_mask);
+   printf("   Rounding: %4s, Precision: %d, Infinity: %d\n", fpu.cont.rnd, fpu.cont.prec, fpu.cont.inf);
+#endif
+
+   /* A compact summary */
+   printf("\n                  3 2 1 0      E S P U O Z D I\n");
+   /* Compact status word */
+   printf("   FST %04X  Cond %d %d %d %d  Err %d %d %d %d %d %d %d %d  ",
+          fpu.env.stat, fpu.stat.c3, fpu.stat.c2, fpu.stat.c1, fpu.stat.c0, fpu.stat.error, fpu.stat.sf,
+          fpu.stat.prec, fpu.stat.under, fpu.stat.over, fpu.stat.zero, fpu.stat.denorm, fpu.stat.inv);
+   if (fpu.stat.c3 && fpu.stat.c2 && fpu.stat.c0) { /* print the result of FCOM(P)(P) */
+      printf("(Unordered)\n");
+   } else if (!fpu.stat.c3 && !fpu.stat.c2 && !fpu.stat.c0) {
+      printf("(GT)\n");
+   } else if (!fpu.stat.c3 && !fpu.stat.c2 && fpu.stat.c0) {
+      printf("(LT)\n");
+   } else if (fpu.stat.c3 && !fpu.stat.c2 && !fpu.stat.c0) {
+      printf("(EQ)\n");
+   } else {
+      printf("\n");
+   }
+
+   /* Compact control word */
+   printf("   FCW %04X  Prec %s,%d  Mask    %d %d %d %d %d %d\n\n",
+          fpu.env.cont, fpu.cont.rnd, fpu.cont.prec, fpu.cont.prec_mask, fpu.cont.under_mask,
+          fpu.cont.over_mask, fpu.cont.zero_mask, fpu.cont.denorm_mask, fpu.cont.inv_mask);
+
+   /* Print out all the data registers in stack order */
+   for(fpu_i = 0; fpu_i < 8; fpu_i++) {
+      /* Stack, register, value, tag */
+      printf("ST%d %6s %26.20G   REG%d\n", fpu_i, fpu.tags[(fpu_i + fpu.stat.top) % 8],
+             (double)fpu.regs[fpu_i], (fpu_i + fpu.stat.top) % 8);
+      /* Hex dump, left->right MSB->LSB */
+      /* Format is: exponent mantissa-hi mantissa-low */
+      printf("               %04hX %08X %08X\n\n", *((short*)&fpu.env.regs[fpu_i] + 4),
+             *((int*)(((short*)&fpu.env.regs[fpu_i] + 2))),
+             *((int*)(((short*)&fpu.env.regs[fpu_i] + 0))));
+   }
+
+   printf("========================= GOODBYE =========================\n\n\n");
+
+   return;
+}
+
+#endif


fix free stack

fix free stack

--- fq_utils.c
+++ fq_utils.c
@@ -119,11 +119,12 @@

   while(ck_pr_load_32(&stack->size) > stack->max_size) {
     ck_stack_entry_t *ce = ck_stack_batch_pop_mpmc(&stack->stack);
-    while (ce != NULL) {
+    if (ce != NULL) {
       fq_msg *m = container_of(ce, fq_msg, cleanup_stack_entry);
       ce = ce->next;
       free(m);
     }
+    else break;
   }
   uint32_t c = ck_pr_load_32(&stack->size);
   if (c >= stack->max_size) {


Ensure MIME_TYPE & TLS_TYPE panels are not shown if not available.

--- src/commons.c
+++ src/commons.c
@@ -412,6 +412,14 @@
     if (str_inarray ("CACHE_STATUS", conf.ignore_panels, ignore_panel_idx) < 0)
       remove_module (CACHE_STATUS);
   }
+  if (!strstr (conf.log_format, "%M") && ignore_panel_idx < TOTAL_MODULES) {
+    if (str_inarray ("MIME_TYPE", conf.ignore_panels, ignore_panel_idx) < 0)
+      remove_module (MIME_TYPE);
+  }
+  if (!strstr (conf.log_format, "%K") && ignore_panel_idx < TOTAL_MODULES) {
+    if (str_inarray ("TLS_TYPE", conf.ignore_panels, ignore_panel_idx) < 0)
+      remove_module (TLS_TYPE);
+  }
 #ifdef HAVE_GEOLOCATION
 #ifdef HAVE_LIBMAXMINDDB
   if (!conf.geoip_database && ignore_panel_idx < TOTAL_MODULES) {


inline user_path_create()

inline user_path_create()

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

--- fs/namei.c
+++ fs/namei.c
@@ -3457,7 +3457,7 @@
 }
 EXPORT_SYMBOL(done_path_create);

-struct dentry *user_path_create(int dfd, const char __user *pathname,
+inline struct dentry *user_path_create(int dfd, const char __user *pathname,
 				struct path *path, unsigned int lookup_flags)
 {
 	return filename_create(dfd, getname(pathname), path, lookup_flags);


[PATCH] VFS: memory leak in do_kern_mount()

There is a memory leak during mount when CONFIG_SECURITY is enabled and
mount options are specified.

Signed-off-by: Gerald Schaefer <a9f4a477c79cb7dfff852c5914623295614196f0@de.ibm.com>
Acked-by: James Morris <10d11de3abc355eabe955bb734f0f8e71da56e16@redhat.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- fs/super.c
+++ fs/super.c
@@ -835,6 +835,7 @@
 	mnt->mnt_parent = mnt;
 	mnt->mnt_namespace = current->namespace;
 	up_write(&sb->s_umount);
+	free_secdata(secdata);
 	put_filesystem(type);
 	return mnt;
 out_sb:


NULL noise in fs/super.c:kill_bdev_super()

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Subrata Modak <e73a7adcdd88d754b773a932bde203440e9fc08d@linux.vnet.ibm.com>
Signed-off-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>

--- fs/super.c
+++ fs/super.c
@@ -922,7 +922,7 @@
 	struct block_device *bdev = sb->s_bdev;
 	fmode_t mode = sb->s_mode;

-	bdev->bd_super = 0;
+	bdev->bd_super = NULL;
 	generic_shutdown_super(sb);
 	sync_blockdev(bdev);
 	close_bdev_exclusive(bdev, mode);


VFS: trivial: fix comment on s_maxbytes value warning check

I originally intended to remove this warning in 2.6.34, but it's not in
a high performance codepath and might help us to catch bugs later. Let's
keep it, but fix the comment to allay confusion about its removal.

Signed-off-by: Jeff Layton <4376fbf8623cd7b7c0232225289bb91cedc0a27f@redhat.com>
Signed-off-by: Steve French <d47560e3bac353b8d509d093b1d727868ac7ddf3@us.ibm.com>

--- fs/super.c
+++ fs/super.c
@@ -948,8 +948,7 @@
 	 * filesystems should never set s_maxbytes larger than MAX_LFS_FILESIZE
 	 * but s_maxbytes was an unsigned long long for many releases. Throw
 	 * this warning for a little while to try and catch filesystems that
-	 * violate this rule. This warning should be either removed or
-	 * converted to a BUG() in 2.6.34.
+	 * violate this rule.
 	 */
 	WARN((sb->s_maxbytes < 0), "%s set sb->s_maxbytes to "
 		"negative value (%lld)\n", type->name, sb->s_maxbytes);


shut off old LED when a new LED is set

shut off old LED when a new LED is set

BUG=#1

--- fw/blink.c
+++ fw/blink.c
@@ -62,6 +62,9 @@

 void blink_set_led(uint8_t led)
 {
+	// turn of old blink led
+	led_off(blink_led);
+
 	blink_led = led;
 }


Fix warning about (pointer > 0) comparison

--- cuser/common.h
+++ cuser/common.h
@@ -334,7 +334,7 @@
 	if (__bss_start < __bss_end) {
 		map_anon(PROT_READ | PROT_WRITE, __bss_start, __bss_end - __bss_start);
 	}
-	if (__data_size > 0) memcpy(__data_vma, __data_lma, (uint64_t)&__data_size);
+	memcpy(__data_vma, __data_lma, (uintptr_t)&__data_size);
 }

 static u64 portio(u16 port, u64 flags, u64 data) {


Fix memory allocation on custom checks

Fix memory allocation on custom checks

--- custom_check.c
+++ custom_check.c
@@ -7,7 +7,7 @@
 extern custom_check_t custom_check_create(char *query, char *operator,
 					  char *expected_result)
 {
-    custom_check_t check = malloc(sizeof(custom_check_t));
+    custom_check_t check = malloc(sizeof(struct custom_check));

     if (check) {


added specialization to distribution::cast<> for same type that returns a reference to this rather than a copy (for efficiency)

--- src/stats/distribution.h
+++ src/stats/distribution.h
@@ -35,6 +35,7 @@

 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_same.hpp>

 namespace ML {
 namespace Stats {
@@ -84,8 +85,13 @@
     distribution &
     operator = (const F & val)
     {
+        this->fill(val);
+        return *this;
+    }
+
+    void fill(const F & val)
+    {
         std::fill(this->begin(), this->end(), val);
-        return *this;
     }

     distribution
@@ -229,11 +235,29 @@
         return false;
     }

+    template<typename T1, typename T2>
+    struct is_same_type : boost::false_type {
+    };
+
+    template<typename T>
+    struct is_same_type<T, T> : boost::true_type {
+    };
+
+    // Version of cast to cast to another type
     template<class Other>
-    distribution<Other>
+    typename boost::disable_if<is_same_type<F, Other>, distribution<Other> >::type
     cast() const
     {
         return distribution<Other>(this->begin(), this->end());
+    }
+
+    // Version of cast to cast to the same type; returns a reference which is
+    // more efficient.
+    template<class Other>
+    typename boost::enable_if<is_same_type<F, Other>, const distribution<F, Underlying> &>::type
+    cast() const
+    {
+        return *this;
     }

     template<class Archive>


stats: Don't increase session stats based on command stats. This was buggy because the session stats were now increased twice. It could have been possible to keep doing this and on UPDATE-SESSION simply replace the old session stats, but that might still have caused the session stats to temporarily go too high and then drop down.

--- src/stats/mail-command.c
+++ src/stats/mail-command.c
@@ -137,7 +137,7 @@
 	} else {
 		if (!mail_stats_diff(&cmd->stats, &stats, &diff_stats,
 				     &error)) {
-			*error_r = t_strconcat("UPDATE-SESSION: stats shrank: ",
+			*error_r = t_strconcat("UPDATE-CMD: stats shrank: ",
 					       error, NULL);
 			return -1;
 		}
@@ -148,7 +148,7 @@
 		cmd->id = 0;
 		mail_command_unref(&cmd);
 	}
-	mail_session_refresh(session, &diff_stats);
+	mail_session_refresh(session, NULL);
 	return 0;
 }


Build fix, destructor must be virtual

Build fix, destructor must be virtual

RuntimeRegistryObserver has virtual methods, so destructor must be virtual.
This check is enforced on the Mac and the build fails.

--- application/browser/application_process_manager.h
+++ application/browser/application_process_manager.h
@@ -35,7 +35,7 @@
 class ApplicationProcessManager : public RuntimeRegistryObserver {
  public:
   explicit ApplicationProcessManager(xwalk::RuntimeContext* runtime_context);
-  ~ApplicationProcessManager();
+  virtual ~ApplicationProcessManager();

   bool LaunchApplication(xwalk::RuntimeContext* runtime_context,
                          const Application* application);


error messages

error messages

--- tensorflow/core/kernels/map_kernels.h
+++ tensorflow/core/kernels/map_kernels.h
@@ -115,8 +115,8 @@
     OP_REQUIRES_OK(c, GetInputMap(c, 0, &m));

     OP_REQUIRES(c, m->tensors().find(key) != m->tensors().end(),
-                errors::InvalidArgument("Trying to lookup non-existent key. Could"
-                                        " not find " + key.SummarizeValue(100)));
+                errors::InvalidArgument("Trying to lookup non-existent key. Could not "
+                                        "find key \"" + key.SummarizeValue(100) + "\"."));

     c->set_output(0, m->tensors().find(key)->second);
   }
@@ -149,7 +149,8 @@
     OP_REQUIRES_OK(c, GetInputMap(c, 0, &m));

     OP_REQUIRES(c, m->tensors().find(key) != m->tensors().end(),
-                errors::InvalidArgument("Trying to erase non-existent item."));
+                errors::InvalidArgument("Trying to erase non-existent item. Could not "
+                                        "find key \"" + key.SummarizeValue(100) + "\"."));

     TensorMap* output_map = nullptr;
     OP_REQUIRES_OK(c, ForwardInputOrCreateNewMap(c, 0, 0, *m, &output_map));


  * Added test code of the <textarea> tag for au HDML converter.

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

--- test/chxj_hdml/test_chxj_hdml.c
+++ test/chxj_hdml/test_chxj_hdml.c
@@ -384,30 +384,6 @@

 void test_hdml_textarea_tag_001();
 void test_hdml_textarea_tag_002();
-void test_hdml_textarea_tag_003();
-void test_hdml_textarea_tag_004();
-void test_hdml_textarea_tag_005();
-void test_hdml_textarea_tag_006();
-void test_hdml_textarea_tag_007();
-void test_hdml_textarea_tag_008();
-void test_hdml_textarea_tag_009();
-void test_hdml_textarea_tag_010();
-void test_hdml_textarea_tag_011();
-void test_hdml_textarea_tag_012();
-void test_hdml_textarea_tag_013();
-void test_hdml_textarea_tag_014();
-void test_hdml_textarea_tag_015();
-void test_hdml_textarea_tag_016();
-void test_hdml_textarea_tag_017();
-void test_hdml_textarea_tag_018();
-void test_hdml_textarea_tag_019();
-void test_hdml_textarea_tag_020();
-void test_hdml_textarea_tag_021();
-void test_hdml_textarea_tag_022();
-void test_hdml_textarea_tag_023();
-void test_hdml_textarea_tag_024();
-void test_hdml_textarea_tag_025();
-void test_hdml_textarea_tag_026();

 void test_hdml_title_tag_001();
 void test_hdml_title_tag_002();
@@ -886,32 +862,8 @@
   /* <textarea>                                                              */
   /*=========================================================================*/
   CU_add_test(hdml_suite, "test <textarea> 1." ,                               test_hdml_textarea_tag_001);
+  CU_add_test(hdml_suite, "test <textarea> 2." ,                               test_hdml_textarea_tag_002);
 #if 0
-  CU_add_test(hdml_suite, "test <textarea> 2." ,                               test_hdml_textarea_tag_002);
-  CU_add_test(hdml_suite, "test <textarea> 3." ,                               test_hdml_textarea_tag_003);
-  CU_add_test(hdml_suite, "test <textarea> 4." ,                               test_hdml_textarea_tag_004);
-  CU_add_test(hdml_suite, "test <textarea> 5." ,                               test_hdml_textarea_tag_005);
-  CU_add_test(hdml_suite, "test <textarea> 6." ,                               test_hdml_textarea_tag_006);
-  CU_add_test(hdml_suite, "test <textarea> 7." ,                               test_hdml_textarea_tag_007);
-  CU_add_test(hdml_suite, "test <textarea> 8." ,                               test_hdml_textarea_tag_008);
-  CU_add_test(hdml_suite, "test <textarea> 9." ,                               test_hdml_textarea_tag_009);
-  CU_add_test(hdml_suite, "test <textarea> 10." ,                              test_hdml_textarea_tag_010);
-  CU_add_test(hdml_suite, "test <textarea> 11." ,                              test_hdml_textarea_tag_011);
-  CU_add_test(hdml_suite, "test <textarea> 12." ,                              test_hdml_textarea_tag_012);
-  CU_add_test(hdml_suite, "test <textarea> 13." ,                              test_hdml_textarea_tag_013);
-  CU_add_test(hdml_suite, "test <textarea> 14." ,                              test_hdml_textarea_tag_014);
-  CU_add_test(hdml_suite, "test <textarea> 15." ,                              test_hdml_textarea_tag_015);
-  CU_add_test(hdml_suite, "test <textarea> 16." ,                              test_hdml_textarea_tag_016);
-  CU_add_test(hdml_suite, "test <textarea> 17." ,                              test_hdml_textarea_tag_017);
-  CU_add_test(hdml_suite, "test <textarea> 18." ,                              test_hdml_textarea_tag_018);
-  CU_add_test(hdml_suite, "test <textarea> 19." ,                              test_hdml_textarea_tag_019);
-  CU_add_test(hdml_suite, "test <textarea> 20." ,                              test_hdml_textarea_tag_020);
-  CU_add_test(hdml_suite, "test <textarea> 21." ,                              test_hdml_textarea_tag_021);
-  CU_add_test(hdml_suite, "test <textarea> 22." ,                              test_hdml_textarea_tag_022);
-  CU_add_test(hdml_suite, "test <textarea> 23." ,                              test_hdml_textarea_tag_023);
-  CU_add_test(hdml_suite, "test <textarea> 24." ,                              test_hdml_textarea_tag_024);
-  CU_add_test(hdml_suite, "test <textarea> 25." ,                              test_hdml_textarea_tag_025);
-  CU_add_test(hdml_suite, "test <textarea> 26." ,                              test_hdml_textarea_tag_026);

   /*=========================================================================*/
   /* <title>                                                                 */
@@ -10253,8 +10205,27 @@
 /*============================================================================*/
 void test_hdml_textarea_tag_001()
 {
-#define  TEST_STRING "<textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\r\n"
+#define  TEST_STRING "<form><textarea></textarea></form>"
+#define  RESULT_STRING \
+"<HDML VERSION=3.0 TTL=0 MARKABLE=TRUE>\r\n" \
+"<NODISPLAY NAME=D0>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=GOSUB DEST=#D1 NEXT=#D2 CLEAR=TRUE>\r\n" \
+"</NODISPLAY>\r\n" \
+"<DISPLAY NAME=D2 TITLE=\"NO TITLE\">\r\n" \
+"<ACTION TYPE=ACCEPT TASK=NOOP LABEL=\" \">\r\n" \
+"[$E00000300]\r\n" \
+"\r\n" \
+"</DISPLAY>\r\n" \
+"<ENTRY NAME=D3  KEY=V DEFAULT=$V  MARKABLE=FALSE>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=RETURN RETVALS=$V>\r\n" \
+"</ENTRY>\r\n" \
+"<NODISPLAY NAME=F0>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=GO METHOD=POST DEST=\"\" POSTDATA=\"=$E00000400&_chxj_dmy=\" CLEAR=TRUE >\r\n" \
+"</NODISPLAY>\r\n" \
+"<NODISPLAY NAME=D1>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=RETURN VARS=\"E00000500=\" CLEAR=TRUE>\r\n" \
+"</NODISPLAY>\r\n" \
+"</HDML>\r\n"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -10282,732 +10253,58 @@
 #undef TEST_STRING
 #undef RESULT_STRING
 }
+void test_hdml_textarea_tag_002()
+{
+#define  TEST_STRING "<form><textarea>あああ\r\nいいいい\r\n</textarea></form>"
+#define  RESULT_STRING \
+"<HDML VERSION=3.0 TTL=0 MARKABLE=TRUE>\r\n" \
+"<NODISPLAY NAME=D0>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=GOSUB DEST=#D1 NEXT=#D2 CLEAR=TRUE>\r\n" \
+"</NODISPLAY>\r\n" \
+"<DISPLAY NAME=D2 TITLE=\"NO TITLE\">\r\n" \
+"<ACTION TYPE=ACCEPT TASK=NOOP LABEL=\" \">\r\n" \
+"[$E00000300]\r\n" \
+"あああいいいい\r\n" \
+"</DISPLAY>\r\n" \
+"<ENTRY NAME=D3  KEY=V DEFAULT=$V  MARKABLE=FALSE>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=RETURN RETVALS=$V>\r\n" \
+"</ENTRY>\r\n" \
+"<NODISPLAY NAME=F0>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=GO METHOD=POST DEST=\"\" POSTDATA=\"=$E00000400&_chxj_dmy=\" CLEAR=TRUE >\r\n" \
+"</NODISPLAY>\r\n" \
+"<NODISPLAY NAME=D1>\r\n" \
+"<ACTION TYPE=ACCEPT TASK=RETURN VARS=\"E00000500=あああ\r\n" \
+"いいいい\" CLEAR=TRUE>\r\n" \
+"</NODISPLAY>\r\n" \
+"</HDML>\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;
+  form_no_counter = 0;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_exchange_hdml(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "actual=[%s]\n", ret);
+  fprintf(stderr, "except=[%s]\n", RESULT_STRING);
+  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
+}
 /*KONNO*/
-void test_hdml_textarea_tag_002()
-{
-#define  TEST_STRING "<textarea></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_003()
-{
-#define  TEST_STRING "<textarea>あああ</textarea>"
-#define  RESULT_STRING "<textarea>\r\nあああ</textarea>\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_hdml(&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_hdml_textarea_tag_004()
-{
-#define  TEST_STRING "<textarea>あああ\nいいい</textarea>"
-#define  RESULT_STRING "<textarea>\r\nあああ\nいいい</textarea>\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_hdml(&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_hdml_textarea_tag_005()
-{
-#define  TEST_STRING "<textarea>あああ\r\nいいい</textarea>"
-#define  RESULT_STRING "<textarea>\r\nあああ\r\nいいい</textarea>\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_hdml(&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_hdml_textarea_tag_006()
-{
-#define  TEST_STRING "<textarea>あああ\r\nいいい\n</textarea>"
-#define  RESULT_STRING "<textarea>\r\nあああ\r\nいいい\n</textarea>\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_hdml(&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_hdml_textarea_tag_007()
-{
-#define  TEST_STRING "<textarea>あああ\r\nいいい\r\n</textarea>"
-#define  RESULT_STRING "<textarea>\r\nあああ\r\nいいい\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_008()
-{
-#define  TEST_STRING "<textarea name></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_009()
-{
-#define  TEST_STRING "<textarea name=\"\"></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_010()
-{
-#define  TEST_STRING "<textarea name=\"aaa\"></textarea>"
-#define  RESULT_STRING "<textarea name=\"aaa\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_011()
-{
-#define  TEST_STRING "<textarea rows></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_012()
-{
-#define  TEST_STRING "<textarea rows=\"\"></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_013()
-{
-#define  TEST_STRING "<textarea rows=\"abc\"></textarea>"
-#define  RESULT_STRING "<textarea rows=\"abc\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_014()
-{
-#define  TEST_STRING "<textarea cols></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_015()
-{
-#define  TEST_STRING "<textarea cols=\"\"></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_016()
-{
-#define  TEST_STRING "<textarea cols=\"123\"></textarea>"
-#define  RESULT_STRING "<textarea cols=\"123\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_017()
-{
-#define  TEST_STRING "<textarea accesskey></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_018()
-{
-#define  TEST_STRING "<textarea accesskey=\"\"></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_019()
-{
-#define  TEST_STRING "<textarea accesskey=\"10\"></textarea>"
-#define  RESULT_STRING "<textarea accesskey=\"10\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_020()
-{
-#define  TEST_STRING "<textarea istyle></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_021()
-{
-#define  TEST_STRING "<textarea istyle=\"\"></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_022()
-{
-#define  TEST_STRING "<textarea istyle=\"1\"></textarea>"
-#define  RESULT_STRING "<textarea FORMAT=\"*M\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_023()
-{
-#define  TEST_STRING "<textarea istyle=\"2\"></textarea>"
-#define  RESULT_STRING "<textarea FORMAT=\"*M\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_024()
-{
-#define  TEST_STRING "<textarea istyle=\"3\"></textarea>"
-#define  RESULT_STRING "<textarea FORMAT=\"*m\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_025()
-{
-#define  TEST_STRING "<textarea istyle=\"4\"></textarea>"
-#define  RESULT_STRING "<textarea FORMAT=\"*N\">\r\n</textarea>\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_hdml(&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_hdml_textarea_tag_026()
-{
-#define  TEST_STRING "<textarea istyle=\"a\"></textarea>"
-#define  RESULT_STRING "<textarea>\r\n</textarea>\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_hdml(&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
-}
 /*============================================================================*/
 /* <TITLE>                                                                    */
 /*============================================================================*/


Update main.c

Update main.c

--- csource/main.c
+++ csource/main.c
@@ -1,4 +1,10 @@
 #include <stdio.h>
+
+/**
+ * @author: https://twitter.com/isocroft
+ * @license: MIT
+ *
+ */

 int main() {


Avoid Coverity DEADCODE warning

Avoid Coverity DEADCODE warning

Commit '922b7fda' resulted in two DEADCODE warnings from Coverity in
remoteDispatchAuthPolkit and virAccessDriverPolkitFormatProcess.
Commit '604ae657' modified the daemon.c code to remove the deadcode
issue, but did not do so for viracessdriverpolkit.c. This just mimics
the same changes

--- src/access/viraccessdriverpolkit.c
+++ src/access/viraccessdriverpolkit.c
@@ -76,8 +76,9 @@
     const char *callerTime = NULL;
     const char *callerUid = NULL;
     char *ret = NULL;
-    bool supportsuid = false;
+#ifndef PKCHECK_SUPPORTS_UID
     static bool polkitInsecureWarned;
+#endif

     if (!identity) {
         virAccessError(VIR_ERR_ACCESS_DENIED,
@@ -109,19 +110,17 @@
     }

 #ifdef PKCHECK_SUPPORTS_UID
-    supportsuid = true;
+    if (virAsprintf(&ret, "%s,%s,%s", callerPid, callerTime, callerUid) < 0)
+        goto cleanup;
+#else
+    if (!polkitInsecureWarned) {
+        VIR_WARN("No support for caller UID with pkcheck. "
+                 "This deployment is known to be insecure.");
+        polkitInsecureWarned = true;
+    }
+    if (virAsprintf(&ret, "%s,%s", callerPid, callerTime) < 0)
+        goto cleanup;
 #endif
-    if (supportsuid) {
-        if (virAsprintf(&ret, "%s,%s,%s", callerPid, callerTime, callerUid) < 0)
-            goto cleanup;
-    } else {
-        if (!polkitInsecureWarned) {
-            VIR_WARN("No support for caller UID with pkcheck. This deployment is known to be insecure.");
-            polkitInsecureWarned = true;
-        }
-        if (virAsprintf(&ret, "%s,%s", callerPid, callerTime) < 0)
-            goto cleanup;
-    }

 cleanup:
     virObjectUnref(identity);


connect: Do not fail if the connect is in progress.

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- src/connect.c
+++ src/connect.c
@@ -383,7 +383,7 @@
     }

     rc = connect(s, itr->ai_addr, itr->ai_addrlen);
-    if (rc == -1) {
+    if (rc == -1 && (errno != EINPROGRESS)) {
       ssh_set_error(session, SSH_FATAL,
           "Failed to connect: %s", strerror(errno));
       ssh_connect_socket_close(s);


[POWERPC] kernel: Remove loops_per_jiffy code for 7448HPC2 platforms

Remove loops_per_jiffy early initialization code for 7448HPC2 platforms.
Since udelay no longer uses loops_per_jiffy it is not necessary to
initialize it early.

Signed-off-by: Roy Zang <92ed1c14064887f35fb7c11647aa298140d4f700@freescale.com>
Signed-off-by: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>

--- arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -72,22 +72,10 @@

 static void __init mpc7448_hpc2_setup_arch(void)
 {
-	struct device_node *cpu;
 	struct device_node *np;
 	if (ppc_md.progress)
 		ppc_md.progress("mpc7448_hpc2_setup_arch():set_bridge", 0);

-	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
-		const unsigned int *fp;
-
-		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
-			loops_per_jiffy = *fp / HZ;
-		else
-			loops_per_jiffy = 50000000 / HZ;
-		of_node_put(cpu);
-	}
 	tsi108_csr_vir_base = get_vir_csrbase();

 	/* setup PCI host bridge */


Bug 1008875: Moved RF-index parser to separate function

The RF-index parser has been moved to a separate function. This
commit also fixes a bug, where the parser was called for empty
input strings.

Signed-off-by: Thomas Zimmermann <9db2882e8bd65115896ebac31a8fb3c23a33f58a@users.sourceforge.net>

--- src/console.c
+++ src/console.c
@@ -422,6 +422,31 @@
     }
     if (!(*ntype < NUMBER_OF_NCI_NOTIFICATION_TYPES)) {
         control_write(client, "KO: unknown discover notification type %zu\r\n", *ntype);
+        return -1;
+    }
+    return 0;
+}
+
+static int
+parse_rf_index(ControlClient client, char** args, unsigned long* rf)
+{
+    const char* p;
+
+    assert(client);
+    assert(args);
+    assert(rf);
+
+    p = strsep(args, " ");
+    errno = 0;
+    *rf = strtol(p, NULL, 0);
+    if (errno) {
+        control_write(client,
+                      "KO: invalid rf index '%s', error %d(%s)\r\n",
+                      p, errno, strerror(errno));
+        return -1;
+    }
+    if (*rf < -1 || *rf >= NUMBER_OF_SUPPORTED_NCI_RF_INTERFACES) {
+        control_write(client, "KO: unknown rf index %d\r\n", *rf);
         return -1;
     }
     return 0;
@@ -617,24 +642,13 @@
             }
             param.re = nfc_res + i;

-            /* read rf interface index */
-            p = strsep(&args, " ");
-            if (!p) {
-                param.rf = -1;
-            } else {
-                errno = 0;
-                param.rf = strtol(p, NULL, 0);
-                if (errno) {
-                    control_write(client,
-                                  "KO: invalid rf index '%s', error %d(%s)\r\n",
-                                  p, errno, strerror(errno));
+            if (args && *args) {
+                /* read rf interface index */
+                if (parse_rf_index(client, &args, &param.rf) < 0) {
                     return -1;
                 }
-                if (param.rf < -1 ||
-                    param.rf >= NUMBER_OF_SUPPORTED_NCI_RF_INTERFACES) {
-                    control_write(client, "KO: unknown rf index %d\r\n", param.rf);
-                    return -1;
-                }
+            } else {
+                param.rf = -1;
             }
         } else {
             param.re = NULL;


context BUGFIX pass error code when internal module parsing fails

--- src/context.c
+++ src/context.c
@@ -215,7 +215,7 @@
     /* load internal modules */
     for (i = 0; i < ((options & LY_CTX_NOYANGLIBRARY) ? (LY_INTERNAL_MODS_COUNT - 2) : LY_INTERNAL_MODS_COUNT); i++) {
         module = (struct lys_module *)lys_parse_mem(ctx, internal_modules[i].data, internal_modules[i].format);
-        LY_CHECK_GOTO(!module, error);
+        LY_CHECK_ERR_GOTO(!module, rc = ly_errcode(ctx), error);
         module->parsed->implemented = internal_modules[i].implemented;
     }


src/context: errors must be cleared if not propagated

Signed-off-by: Enrico Jorns <a2e5f936c390f36494e46e71bcfbe365bb1e8c49@pengutronix.de>

--- src/context.c
+++ src/context.c
@@ -83,11 +83,12 @@
 	res = load_config(context->configpath, &context->config, &error);
 	if (!res && error->domain==g_file_error_quark()) {
 		g_debug("system config not found, using default values");
+		g_clear_error(&error);
 		res = default_config(&context->config);
 	}
 	if (!res) {
 		g_error("failed to initialize context: %s", error->message);
-
+		g_clear_error(&error);
 	}

 	if (context->config->systeminfo_handler &&


removed last reminiants of market models

--- src/context.h
+++ src/context.h
@@ -15,7 +15,6 @@
 class EventManager;
 class Event;
 class Trader;
-class MarketModel;
 class Timer;
 class TimeAgent;

@@ -98,9 +97,6 @@
   /// See Timer::RegisterTickListener documentation.
   void RegisterTicker(TimeAgent* ta);

-  /// See Timer::RegisterResolveListener documentation.
-  void RegisterResolver(MarketModel* mkt);
-
   /// Initializes the simulation time parameters. Should only be called once -
   /// NOT idempotent.
   void InitTime(int start, int duration, int decay, int m0 = 1, int y0 = 2010,


Updating `procecure?` to include forms (both syntactic and not), this may clash with the standard.

--- src/control.c
+++ src/control.c
@@ -27,7 +27,7 @@
         return plot_runtime_error(plot_error_bad_args, "first arg was null", "plot_func_procedure_test");
     }

-    return plot_new_boolean( val->type == plot_type_legacy || val->type == plot_type_lambda );
+    return plot_new_boolean( val->type == plot_type_legacy || val->type == plot_type_lambda || val->type == plot_type_form  );
 }

 /* (apply proc args1 ... args)


Update year

Update year

--- src/copying.h
+++ src/copying.h
@@ -1,5 +1,5 @@
 const gchar *copyright =""
-"Copyright (c) 2012-2013, HAYASHI Kentaro <kenhys@gmail.com>\n"
+"Copyright (c) 2012-2015, HAYASHI Kentaro <kenhys@gmail.com>\n"
 "All rights reserved.\n"
 "\n"
 "Redistribution and use in source and binary forms, with or without modification,\n"


Fix lovr.filesystem.getExecutablePath on macOS;

--- src/core/fs.c
+++ src/core/fs.c
@@ -311,6 +311,13 @@
   return true;
 }

+#ifdef __APPLE__
+#include <objc/objc-runtime.h>
+#include <mach-o/dyld.h>
+#elif __ANDROID__
+extern const char* lovrOculusMobileWritablePath; // TODO
+#endif
+
 static size_t copy(char* buffer, size_t size, const char* string, size_t length) {
   if (length >= size) { return 0; }
   memcpy(buffer, string, length);
@@ -332,7 +339,6 @@
   return copy(buffer, size, home, strlen(home));
 }

-extern const char* lovrOculusMobileWritablePath; // TODO
 size_t fs_getDataDir(char* buffer, size_t size) {
 #if __APPLE__
   size_t cursor = fs_getHomeDir(buffer, size);
@@ -370,8 +376,10 @@
 }

 size_t fs_getExecutablePath(char* buffer, size_t size) {
-#if __APPLE_
-  return _NSGetExecutablePath(buffer, &size) ? 0 : size;
+#if __APPLE__
+  uint32_t size32 = size;
+  _NSGetExecutablePath(buffer, &size32);
+  return size32;
 #elif EMSCRIPTEN
   return 0;
 #else
@@ -379,10 +387,6 @@
   return (length < 0) ? 0 : (size_t) length;
 #endif
 }
-
-#ifdef __APPLE__
-#include <objc/objc-runtime.h>
-#endif

 size_t fs_getBundlePath(char* buffer, size_t size) {
 #ifdef __APPLE__


Trivial refactor: Remove extern keyword from function declarations, as they are extern by default.

--- src/core_io.h
+++ src/core_io.h
@@ -15,18 +15,18 @@
 class UniValue;

 // core_read.cpp
-extern CScript ParseScript(const std::string& s);
-extern std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
-extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx, bool fTryNoWitness = false);
-extern bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
-extern uint256 ParseHashUV(const UniValue& v, const std::string& strName);
-extern uint256 ParseHashStr(const std::string&, const std::string& strName);
-extern std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
+CScript ParseScript(const std::string& s);
+std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
+bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx, bool fTryNoWitness = false);
+bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
+uint256 ParseHashUV(const UniValue& v, const std::string& strName);
+uint256 ParseHashStr(const std::string&, const std::string& strName);
+std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);

 // core_write.cpp
-extern std::string FormatScript(const CScript& script);
-extern std::string EncodeHexTx(const CTransaction& tx);
-extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
-extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry);
+std::string FormatScript(const CScript& script);
+std::string EncodeHexTx(const CTransaction& tx);
+void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
+void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry);

 #endif // BITCOIN_CORE_IO_H


code miss fix

code miss fix

--- src/counter.c
+++ src/counter.c
@@ -5,6 +5,7 @@

 #include "common.h"
 #include "counter.h"
+#include "uart.h"

 #define CNT_NUM        10

@@ -23,7 +24,7 @@

 void CounterInit( void )
 {
-    TC0Init();
+    Tc0Init();
 }

@@ -59,7 +60,7 @@
     }

     if ( TRUE == bIsCntValid ){
-        SetTc0Top();
+        SetTc0Top( unCnt[ucCntState] );
         Tc0Start();
     } else {
         putstr( "Make sure that each Ci in {C1...Cn} is not zero value." );
@@ -97,8 +98,8 @@
 }

-/* T/C0 Compare Match Event --*/
-ISR()
+/*----------------------------------------------- T/C0 Compare Match Event --*/
+ISR( TIMER0_COMP_vect )
 {
     if ( 1 < ucOvfCntRemain ){
         ucOvfCntRemain--;
@@ -106,7 +107,7 @@
         ucOvfCntRemain--;
         OCR0 = ucLastCnt;
     } else {
-        // this stage is complete.
+        // this state is complete.
         if ( ucCntState < ucCntStateMax ){
             SetTc0Top( unCnt[++ucCntState] );
         } else {


when converting gas mv to pressure use mean instead of max_mv

--- get_data.c
+++ get_data.c
@@ -54,6 +54,7 @@

 #define GAS_ID_D2 0
 #define GAS_ID_N2 1
+#define GAS_ID_DEFAULT  GAS_ID_N2

 //#define CAM_ENABLE

@@ -370,7 +371,7 @@

 static void init_data_struct(data_t * data, time_t time_now)
 {
-    int16_t mean_mv, max_mv;
+    int16_t mean_mv;
     int32_t ret, wait_ms;
     bool    ret1, ret2, ret3, ret4;

@@ -405,9 +406,9 @@
     }

     // data part1 pressure_mtorr
-    ret = dataq_get_adc(DATAQ_ADC_CHAN_PRESSURE, NULL, NULL, NULL, NULL, &max_mv);
+    ret = dataq_get_adc(DATAQ_ADC_CHAN_PRESSURE, NULL, &mean_mv, NULL, NULL, NULL);
     if (ret == 0) {
-        data->part1.pressure_mtorr = convert_adc_pressure(max_mv/1000., GAS_ID_D2);
+        data->part1.pressure_mtorr = convert_adc_pressure(mean_mv/1000., GAS_ID_DEFAULT);
     } else {
         data->part1.pressure_mtorr = ERROR_NO_VALUE;
     }
@@ -819,7 +820,7 @@
     uint64_t time_now = time(NULL);
     if (time_now > neutron_time) {
         char voltage_str[100], current_str[100], pressure_str[100];
-        int16_t mean_mv, max_mv;
+        int16_t mean_mv;

         // publish new neutron data
         pthread_mutex_lock(&neutron_mutex);
@@ -847,8 +848,8 @@
         } else {
             sprintf(current_str, "NO_VALUE");
         }
-        if (dataq_get_adc(DATAQ_ADC_CHAN_PRESSURE, NULL, NULL, NULL, NULL, &max_mv) == 0) {
-            float pressure_mtorr = convert_adc_pressure(max_mv/1000., GAS_ID_D2);
+        if (dataq_get_adc(DATAQ_ADC_CHAN_PRESSURE, NULL, &mean_mv, NULL, NULL, NULL) == 0) {
+            float pressure_mtorr = convert_adc_pressure(mean_mv/1000., GAS_ID_DEFAULT);
             if (pressure_mtorr < 1000) {
                 sprintf(pressure_str, "%0.1f mTorr", pressure_mtorr);
             } else {


* div tag.

  * div tag.

git-svn-id: a5f274977ba119e8cb0852a7baa1e58e2494093d@3631 1a406e8e-add9-4483-a2c8-d8cac5b7c224

--- test/chxj_chtml50/test_chxj_chtml50.c
+++ test/chxj_chtml50/test_chxj_chtml50.c
@@ -3670,7 +3670,7 @@
 void test_chtml50_div_tag_001()
 {
 #define  TEST_STRING "

"
-#define  RESULT_STRING ""
+#define  RESULT_STRING "

"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -3782,7 +3782,7 @@
 void test_chtml50_div_tag_005()
 {
 #define  TEST_STRING "

"
-#define  RESULT_STRING ""
+#define  RESULT_STRING "

"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -3810,7 +3810,7 @@
 void test_chtml50_div_tag_006()
 {
 #define  TEST_STRING "

"
-#define  RESULT_STRING ""
+#define  RESULT_STRING "

"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -3838,7 +3838,7 @@
 void test_chtml50_div_tag_007()
 {
 #define  TEST_STRING "

"
-#define  RESULT_STRING ""
+#define  RESULT_STRING "

"
   char  *ret;
   char  *tmp;
   device_table spec;


Added NTP insertion in TEMI

Added NTP insertion in TEMI

--- applications/mp42ts/main.c
+++ applications/mp42ts/main.c
@@ -196,6 +196,7 @@
 	const char *temi_url;
 	u32 last_temi_url;
 	Bool insert_temi;
+	Bool insert_ntp;

 } GF_ESIMP4;
 #endif
@@ -349,6 +350,7 @@
 		if (priv->is_repeat) pck.flags |= GF_ESI_DATA_REPEAT;

 		if (priv->insert_temi) {
+			u64 ntp=0;
 			u64 tc = priv->sample->DTS + priv->sample->CTS_Offset;
 			if (temi_disable_loop) {
 				tc += priv->ts_offset;
@@ -358,7 +360,14 @@
 				tc += ((u64) temi_offset) * ifce->timescale / 1000;
 			}

-			pck.mpeg2_af_descriptors_size = format_af_descriptor(af_data, tc, ifce->timescale, 0, priv->temi_url, &priv->last_temi_url);
+			if (priv->insert_ntp) {
+				u32 sec, frac;
+				gf_net_get_ntp(&sec, &frac);
+				ntp = sec;
+				ntp <<= 32;
+				ntp |= frac;
+			}
+			pck.mpeg2_af_descriptors_size = format_af_descriptor(af_data, tc, ifce->timescale, ntp, priv->temi_url, &priv->last_temi_url);
 			pck.mpeg2_af_descriptors = af_data;
 		}

@@ -1368,7 +1377,7 @@
 }
 #endif

-static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mpeg4_signaling, char *update, char *audio_input_ip, u16 audio_input_port, char *video_buffer, Bool force_real_time, u32 bifs_use_pes, const char *temi_url, Bool compute_max_size)
+static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mpeg4_signaling, char *update, char *audio_input_ip, u16 audio_input_port, char *video_buffer, Bool force_real_time, u32 bifs_use_pes, const char *temi_url, Bool compute_max_size, Bool insert_ntp)
 {
 #ifndef GPAC_DISABLE_STREAMING
 	GF_SDPInfo *sdp;
@@ -1425,7 +1434,9 @@
 						if (!source->pcr_idx) {
 							source->pcr_idx = i+1;
 							if (temi_url) {
-								((GF_ESIMP4 *)source->streams[i].input_udta)->insert_temi = 1;
+								((GF_ESIMP4 *)source->streams[i].input_udta)->insert_temi = GF_TRUE;
+								if (insert_ntp)
+									((GF_ESIMP4 *)source->streams[i].input_udta)->insert_ntp = GF_TRUE;
 								if (strcmp(temi_url, "NOTEMIURL"))
 									((GF_ESIMP4 *)source->streams[i].input_udta)->temi_url = temi_url;
 							}
@@ -1789,7 +1800,7 @@
                                   char** segment_dir, u32 *segment_duration, char **segment_manifest, u32 *segment_number, char **segment_http_prefix, u32 *split_rap, u32 *nb_pck_pack, u32 *pcr_ms, u32 *ttl, const char **ip_ifce, const char **temi_url, u32 *sdt_refresh_rate)
 {
 	Bool rate_found=0, mpeg4_carousel_found=0, time_found=0, src_found=0, dst_found=0, audio_input_found=0, video_input_found=0,
-	     seg_dur_found=0, seg_dir_found=0, seg_manifest_found=0, seg_number_found=0, seg_http_found=0, real_time_found=0;
+	     seg_dur_found=0, seg_dir_found=0, seg_manifest_found=0, seg_number_found=0, seg_http_found=0, real_time_found=0, insert_ntp=0;
 	char *arg = NULL, *next_arg = NULL, *error_msg = "no argument found";
 	u32 mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_NONE;
 	Bool force_real_time = 0;
@@ -2011,6 +2022,8 @@
 			temi_offset = atoi(next_arg);
 		} else if (!stricmp(arg, "-temi-noloop")) {
 			temi_disable_loop = 1;
+		} else if (!stricmp(arg, "-insert-ntp")) {
+			insert_ntp = GF_TRUE;
 		}
 		else if (CHECK_PARAM("-dst-udp")) {
 			char *sep = strchr(next_arg, ':');
@@ -2066,7 +2079,7 @@
 			src_args = src_args + 1;
 		}

-		res = open_source(&sources[*nb_sources], next_arg, *carrousel_rate, mpeg4_signaling, *bifs_src_name, *audio_input_ip, *audio_input_port, *video_buffer, force_real_time, *bifs_use_pes, *temi_url, (*pcr_offset == (u32) -1) ? 1 : 0);
+		res = open_source(&sources[*nb_sources], next_arg, *carrousel_rate, mpeg4_signaling, *bifs_src_name, *audio_input_ip, *audio_input_port, *video_buffer, force_real_time, *bifs_use_pes, *temi_url, (*pcr_offset == (u32) -1) ? 1 : 0, insert_ntp);

 		//we may have arguments


lib: json: Ignore spaces while scanning for tokens

The function to ignore spaces was not being called, so some tokens had
whitespace in the beginning.  They were correctly lexed, but parsing
could eventually fail.

Jira: ZEP-1607
Change-Id: I796596143895fa0fa652641f56af9a03e7a65b7a
Signed-off-by: Leandro Pereira <51c7437a02b34df685e6b4ecb2e9bca23efe2e1a@intel.com>

--- lib/json/json.c
+++ lib/json/json.c
@@ -261,6 +261,7 @@
 			/* fallthrough */
 		default:
 			if (isspace(chr)) {
+				ignore(lexer);
 				continue;
 			}


Fixed windows newline

Fixed windows newline

--- src/csvpipe.c
+++ src/csvpipe.c
@@ -95,6 +95,7 @@
 				// we already had a newline, so lets eat this second windows
 				// newline
 				current_char++;
+				current_start++;
 			}
 			break;
 		default:


Remove __P() usage.

Remove __P() usage.

--- lib/csu/powerpc/crt1.c
+++ lib/csu/powerpc/crt1.c
@@ -66,8 +66,8 @@
  * First 5 arguments are specified by the PowerPC SVR4 ABI.
  * The last argument, ps_strings, is a BSD extension.
  */
-void _start __P((int, char **, char **, const struct Struct_Obj_Entry *,
-		void (*)(void)), struct ps_strings *);
+void _start(int, char **, char **, const struct Struct_Obj_Entry *,
+		void (*)(void), struct ps_strings *);

 char **environ;
 char *__progname = "";


repository_finddeps.c: remove useless code.

--- lib/repository_finddeps.c
+++ lib/repository_finddeps.c
@@ -178,59 +178,6 @@
 		prop_object_release(reqpkg_str);
 		return errno;
 	}
-
-	return rv;
-}
-
-static int
-remove_missing_reqdep(prop_array_t missing_rdeps, const char *reqpkg)
-{
-	prop_object_iterator_t iter = NULL;
-	prop_object_t obj;
-	size_t idx = 0;
-	int rv = 0;
-	bool found = false;
-
-	assert(missing_rdeps != NULL);
-	assert(reqpkg != NULL);
-
-	iter = prop_array_iterator(missing_rdeps);
-	if (iter == NULL)
-		return errno;
-
-	while ((obj = prop_object_iterator_next(iter)) != NULL) {
-		const char *curdep;
-		char *curpkgnamedep, *reqpkgname;
-
-		curdep = prop_string_cstring_nocopy(obj);
-		curpkgnamedep = xbps_get_pkgpattern_name(curdep);
-		if (curpkgnamedep == NULL) {
-			rv = errno;
-			goto out;
-		}
-		reqpkgname = xbps_get_pkgpattern_name(reqpkg);
-		if (reqpkgname == NULL) {
-			free(curpkgnamedep);
-			rv = errno;
-			goto out;
-		}
-		if (strcmp(reqpkgname, curpkgnamedep) == 0)
-			found = true;
-
-		free(curpkgnamedep);
-		free(reqpkgname);
-		if (found)
-			break;
-		idx++;
-	}
-out:
-	prop_object_iterator_release(iter);
-	if (found) {
-		prop_array_remove(missing_rdeps, idx);
-		return 0;
-	}
-	if (rv == 0)
-		rv = ENOENT;

 	return rv;
 }
@@ -426,21 +373,6 @@
 			break;
 		}
 		/*
-		 * If package was added in the missing_deps array, we
-		 * can remove it now it has been found in current repository.
-		 */
-		rv = remove_missing_reqdep(mrdeps, reqpkg);
-		if (rv == ENOENT) {
-			rv = 0;
-		} else if (rv == 0) {
-			xbps_dbg_printf("Removed missing dep %s.\n", reqpkg);
-		} else {
-			xbps_dbg_printf("Removing missing dep %s "
-			    "returned %s\n", reqpkg, strerror(rv));
-			prop_object_release(curpkgd);
-			break;
-		}
-		/*
 		 * If package doesn't have rundeps, pass to the next one.
 		 */
 		curpkg_rdeps = prop_dictionary_get(curpkgd, "run_depends");


test: fix bug in TpmHandleToName

test: fix bug in TpmHandleToName

The name pointer is used before check if NULL.

Signed-off-by: Tadeusz Struk <ac7da5bc34fbda078ba4af5ef710d2a59a2316f5@intel.com>

--- test/integration/session-util.c
+++ test/integration/session-util.c
@@ -126,10 +126,12 @@
     TPM2B_PUBLIC public;
     TPM2B_NV_PUBLIC nvPublic;
     TSS2_SYS_CONTEXT *sysContext;
-    UINT8 *namePtr = name->name;
+    UINT8 *namePtr;

     if (!tcti_context || !name)
         return TSS2_SYS_RC_BAD_VALUE;
+
+    namePtr = name->name;

     switch(handle >> TPM2_HR_SHIFT)
     {


fixed bug due to fflush in stdin read

fixed bug due to fflush in stdin read

git-svn-id: ab66a9de07fa9d47c5829c82992f5279466c775f@1920 63c20433-aa62-49bd-875c-5a186b69a8fb

--- applications/mp4box/live.c
+++ applications/mp4box/live.c
@@ -544,9 +544,10 @@
 					GF_Err e;
 					char szCom[8192];
 					fprintf(stdout, "Enter command to send:\n");
-					fflush(stdin);
 					szCom[0] = 0;
 					scanf("%[^\t\n]", szCom);
+					/*stdin flush bug*/
+					while (getchar()!='\n') {}
 					e = gf_seng_encode_from_string(livesess.seng, 0, 0, szCom, live_session_callback);
 					if (e) fprintf(stdout, "Processing command failed: %s\n", gf_error_to_string(e));
 					e = gf_seng_aggregate_context(livesess.seng, 0);
@@ -561,9 +562,10 @@
 					GF_Err e;
 					char szCom[8192];
 					fprintf(stdout, "Enter command to send:\n");
-					fflush(stdin);
 					szCom[0] = 0;
 					scanf("%[^\t\n]", szCom);
+					/*stdin flush bug*/
+					while (getchar()!='\n') {}
 					e = gf_seng_encode_from_string(livesess.seng, 0, 1, szCom, live_session_callback);
 					if (e) fprintf(stdout, "Processing command failed: %s\n", gf_error_to_string(e));
 					livesess.critical = 0;
@@ -740,6 +742,7 @@
 			livesess.carousel_generation=1;
 			e = gf_seng_encode_context(livesess.seng, live_session_callback	);
 			livesess.carousel_generation=0;
+			update_context = 0
 		}

 		if (livesess.force_carousel) {


doc link update

doc link update

--- applications/mp4box/main.c
+++ applications/mp4box/main.c
@@ -376,7 +376,7 @@
 	gf_sys_format_help(helpout, help_flags, "# DASH Options\n"
 		"Also see:\n"
 		"- the [dasher `gpac -h dash`](dasher) filter documentation\n"
-		"- [[online DASH Intro doc|DASH Introduction]].\n"
+		"- [[DASH wiki|DASH-intro]].\n"
 		"\n"
 		"# Specifying input files\n"
 		"Input media files to dash can use the following modifiers\n"


tests: framework: Silence stderr when lscpu is not found.

--- tests/framework/tst_log.c
+++ tests/framework/tst_log.c
@@ -444,7 +444,7 @@
 	fprintf(f, "\t\t\"CPU\": {");

 	/* lscpu is part of reasonably new util-linux */
-	FILE *cmd = popen("lscpu", "r");
+	FILE *cmd = popen("lscpu 2> /dev/null", "r");

 	if (cmd != NULL) {
 		char id[256], val[1024];


better doc

better doc

--- src/cxxpool.h
+++ src/cxxpool.h
@@ -78,7 +78,7 @@
  * A header-only, portable thread pool for C++
  *
  * Constructing the thread pool launches the worker threads while
- * destructing joins them. The threads will be alive for as long as the
+ * destructing it joins them. The threads will be alive for as long as the
  * thread pool is not destructed.
  *
  * Tasks can be pushed into the pool with and w/o providing a priority >= 0.
@@ -92,7 +92,7 @@
   /**
    * Constructor. The number of threads to launch is determined by calling
    * std::thread::hardware_concurrency()
-   * @throws cxxpool::thread_pool_error if hardware concurrency is invalid
+   * @throws cxxpool::thread_pool_error if hardware concurrency is unavailable
    */
   thread_pool();
   /**
@@ -121,7 +121,7 @@
    * Pushes a new task into the thread pool. The task will have a priority of 0
    * @param functor The functor to call
    * @param args The arguments to pass to the functor when calling it
-   * @return A future associated to the underlying task
+   * @return The future associated to the underlying task
    */
   template<typename Functor, typename... Args>
   auto push(Functor&& functor, Args&&... args)
@@ -131,7 +131,7 @@
    * @param priority A task priority. Higher priorities are processed first
    * @param functor The functor to call
    * @param args The arguments to pass to the functor when calling it
-   * @return A future associated to the underlying task
+   * @return The future associated to the underlying task
    * @throws cxxpool::thread_pool_error if priority < 0
    */
   template<typename Functor, typename... Args>


Calibration progress, needs sphere fitting

--- apps/commander/commander.c
+++ apps/commander/commander.c
@@ -325,8 +325,8 @@
 	uint64_t axis_deadline = hrt_absolute_time();
 	uint64_t calibration_deadline = hrt_absolute_time() + calibration_interval;

-	const char axislabels[3] = { 'X', 'Y', 'Z'};
-	int axis_index = 0;
+	const char axislabels[3] = { 'Z', 'X', 'Y'};
+	int axis_index = -1;

 	while (hrt_absolute_time() < calibration_deadline) {

@@ -334,15 +334,17 @@
 		struct pollfd fds[1] = { { .fd = sub_sensor_combined, .events = POLLIN } };

 		/* user guidance */
-		if (hrt_absolute_time() > axis_deadline &&
+		if (hrt_absolute_time() >= axis_deadline &&
 			axis_index < 3) {
+
+			axis_index++;
+
 			char buf[50];
 			sprintf(buf, "[commander] Please rotate around %c", axislabels[axis_index]);
 			mavlink_log_info(mavlink_fd, buf);
 			ioctl(buzzer, TONE_SET_ALARM, 2);

 			axis_deadline += calibration_interval / 3;
-			axis_index++;
 		}

 		if (!(axis_index < 3)) {
@@ -362,26 +364,26 @@
 			/* get min/max values */

 			/* ignore other axes */
-			if (raw.magnetometer_ga[axis_index] < mag_min[axis_index]) {
-				mag_min[axis_index] = raw.magnetometer_ga[axis_index];
-			}
-			else if (raw.magnetometer_ga[axis_index] > mag_max[axis_index]) {
-				mag_max[axis_index] = raw.magnetometer_ga[axis_index];
-			}
-
-			// if (raw.magnetometer_ga[1] < mag_min[1]) {
-			// 	mag_min[1] = raw.magnetometer_ga[1];
-			// }
-			// else if (raw.magnetometer_ga[1] > mag_max[1]) {
-			// 	mag_max[1] = raw.magnetometer_ga[1];
-			// }
-
-			// if (raw.magnetometer_ga[2] < mag_min[2]) {
-			// 	mag_min[2] = raw.magnetometer_ga[2];
-			// }
-			// else if (raw.magnetometer_ga[2] > mag_max[2]) {
-			// 	mag_max[2] = raw.magnetometer_ga[2];
-			// }
+			if (raw.magnetometer_ga[0] < mag_min[0]) {
+				mag_min[0] = raw.magnetometer_ga[0];
+			}
+			else if (raw.magnetometer_ga[0] > mag_max[0]) {
+				mag_max[0] = raw.magnetometer_ga[0];
+			}
+
+			if (raw.magnetometer_ga[1] < mag_min[1]) {
+				mag_min[1] = raw.magnetometer_ga[1];
+			}
+			else if (raw.magnetometer_ga[1] > mag_max[1]) {
+				mag_max[1] = raw.magnetometer_ga[1];
+			}
+
+			if (raw.magnetometer_ga[2] < mag_min[2]) {
+				mag_min[2] = raw.magnetometer_ga[2];
+			}
+			else if (raw.magnetometer_ga[2] > mag_max[2]) {
+				mag_max[2] = raw.magnetometer_ga[2];
+			}

 			calibration_counter++;
 		} else {


fixed 'creat' function call in create_dazibao

--- src/dazibao.c
+++ src/dazibao.c
@@ -13,7 +13,7 @@
 		return -1;
 	}

-	fd = create(path);
+	fd = creat(path, 644);

 	if (fd == -1) {
 		ERROR("open", -1);


comments formatted with javadoc style

comments formatted with javadoc style

--- src/dazibao.h
+++ src/dazibao.h
@@ -20,94 +20,119 @@

 typedef int dz_t;

-/*
- * Create a new dazibao in a file given by 'path', and fill 'daz_buf'
- * accordingly. If a file already exist, the function doesn't override it
+/**
+ * Create a new dazibao in a file at a given location.
+ * If a file already exist, the function doesn't override it
  * and return an error status instead.
- * Returns 0 on success and -1 on error.
+ * @param daz_buf dazibao to fill with information
+ * @param path location where to create the file
+ * @return 0 on success
+ * @return -1 on error
  */
 int dz_create(dz_t *daz_buf,  char *path);

-/*
- * Open a dazibao. 'flags' flags are passed to the open(2) call used to open
- * the file. Returns 0 on success, -1 on error.
+/**
+ * Open a dazibao.
+ * @param dad_buf dazibao to fill with information
+ * @param path location where to find the file
+ * @param flags flags used with open(2)
+ * @return 0 on succes
+ * @return -1 on error
  */
 int dz_open(dz_t* d,  char* path,  int flags);

-/*
- * Close a dazibao. Returns 0 on success.
+/**
+ * Close a dazibao
+ * @return 0 on success
  */
 int dz_close(dz_t* d);

-/*
- * Fill all the fields of 'buf' with the TLV located at 'offset' offset in the
- * dazibao 'd'. The function returns 0 on success and -1 on error.
+/**
+ * Fill tlv value
+ * @param d dazibao used for reading
+ * @param tlv tlv to be filled
+ * @param offset off wanted tlv
+ * @return 0 on success
+ * @return -1 on error
  */
 int dz_read_tlv(dz_t* d, char *tlv, off_t offset);

-/*
- * Fill the type and length attributes of 'buf' with the TLV located at the
- * current offset in the dazibao 'd'. The function returns the offset of this
- * TLV on success, EOD if the end of file has been reached, and -1 on error.
+/**
+ * Fill tlv with type and length information
+ * @param d dazibao used for reading
+ * @param tlv to be filled
+ * @return offset this tlv on success
+ * @return EOD if end of file reached
+ * @return -1 on error
  */
 off_t dz_next_tlv(dz_t* d, char *tlv);

-/*
- * Fill the type and length attributes of 'buf' with the TLV located at offset
- * 'offset' in the dazibao. The current offset is not modified.
- * The function returns 0 on success and -1 on error.
+/**
+ * Fill tlv with type and length information
+ * @param d dazibao used for reading
+ * @param tlv to be filled
+ * @param offset position of the tlv wanted in d
+ * @return 0 on success
+ * @return -1 on error
  */
 int dz_tlv_at(dz_t* d, char *tlv, off_t offset);

 /* TODO: doc */
 int dz_write_tlv_at(dz_t *d, char *tlv, off_t offset);

-/*
+/**
  * Add a TLV at the end of a dazibao. If the dazibao ends with a sequence
- * of pad1/padN's, the TLV 'src' overrides the beginning of the sequence,
+ * of pad1/padN's, the TLV overrides the beginning of the sequence,
  * and the file is truncated if the TLV is smaller than the total size of the
  * sequence.
+ * @param d dazibao receiving new tlv
+ * @param tlv to add
  */
 int dz_add_tlv(dz_t* d, char *tlv);

-/*
- * Return the offset of the first pad1/padN of a possibly empty sequence of
- * pad1/padN's before 'offset'. If the sequence is empty, the given offset
- * is returned.
- * See also 'dz_pad_serie_end'.
+/**
+ * Look for the beggining of an unbroken pad1/padN serie leading to `offset`.
+ * @return offset of the begging of this serie on search succes
+ * @return {offset} if search was unsuccessful
  */
 off_t dz_pad_serie_start(dz_t* d, off_t offset);

-/*
- * Return the offset of the next TLV after 'offset' which is not a pad1
- * nor padN. If there is none, the end of file offset is returned.
- * See also 'dz_pad_serie_start'.
+/**
+ * Skip tlv at offset, and look for the end of an unbroken pad1/padN serie
+ * starting after the skipped tlv.
+ * @return offset of the end of this serie on search succes
+ * @return offset of next tlv after {offset} if search was unsuccessful
  */
 off_t dz_pad_serie_end(dz_t* d, off_t offset);

-/*
- * Remove the TLV at 'offset' from a dazibao.
+/**
+ * Erase a tlv. If tlv is surrounded by pad1/padN, they will be concatened.
+ * If it leaves pad1/padN at the end of dazibao, it will be truncated
+ * @param d dazibao where is tlv to remove
+ * @param offset offset of the tlv to remove
  */
 int dz_rm_tlv(dz_t* d, off_t offset);

-/*
- * Empty a part of a dazibao, starting at 'start', and of length 'length'.  The
- * part is filled with padN's and pad1's.
+/**
+ * Empty a part of a dazibao.The part is filled with padN/pad1
+ * @param start starting offset of emptying
+ * @param length number of bytes to be erased
  */
 int dz_do_empty(dz_t *d, off_t start, off_t length);

-/*
+/**
  * Compact a Dazibao file. The file must have been opened in read/write mode,
- * and the Dazibao is NOT closed by the function. Also, the dazibao offset is
- * NOT preserved.
- * The function returns the number of bytes saved by the compacting operation,
- * or -1 if an error occured.
+ * and the Dazibao is NOT closed by the function.
+ * Also, the dazibao offset is NOT preserved.
+ * @return number of bytes saved by the compacting operation on success
+ * @return -1 on error
  */
 int dz_compact(dz_t *d);

-/*
- * print tlvs contained in 'daz_buf' on standard output
+/**
+ * dump information of tlv contained in a dazibao on standard output
+ * @param daz_buf
  */
 int dz_dump(dz_t *daz_buf);


continue to work on a bugfix

continue to work on a bugfix

--- src/density.h
+++ src/density.h
@@ -31,6 +31,8 @@
         kpoint_set kpoint_set_;

         std::vector<int> l_by_lm_;
+
+        void init();

         /// Get the local list of occupied bands
         /** Initially bands are distributed over k-points and columns of the MPI grid used for the diagonalization.
@@ -62,6 +64,8 @@
         template <processing_unit_t pu>
         void generate_valence_density_mt_directly();

+        void generate_valence_density_mt_sht();
+
         /// Generate valence density in the interstitial
         void generate_valence_density_it();

@@ -75,6 +79,8 @@
         Density(Global& parameters__, Potential* potential__, mdarray<double, 2>& kpoints__, double* kpoint_weights__,
                 int allocate_f__);

+        Density(Global& parameters__, Potential* potential__, int allocate_f__);
+
         /// Destructor
         ~Density();

@@ -149,6 +155,29 @@
                  int allocate_f__ = pw_component) :
     parameters_(parameters__), potential_(potential__), allocate_f_(allocate_f__), kpoint_set_(parameters__)
 {
+    init();
+
+    band_ = kpoint_set_.band();
+
+    kpoint_set_.clear();
+    kpoint_set_.add_kpoints(kpoints__, kpoint_weights__);
+    kpoint_set_.initialize();
+}
+
+Density::Density(Global& parameters__, Potential* potential__, int allocate_f__ = pw_component) :
+    parameters_(parameters__), potential_(potential__), allocate_f_(allocate_f__), kpoint_set_(parameters__)
+{
+    init();
+}
+
+Density::~Density()
+{
+    delete rho_;
+    for (int j = 0; j < parameters_.num_mag_dims(); j++) delete magnetization_[j];
+}
+
+void Density::init()
+{
     rho_ = new PeriodicFunction<double>(parameters_, parameters_.lmax_rho());
     rho_->allocate(allocate_f_);

@@ -205,23 +234,12 @@
         }
     }

-    band_ = kpoint_set_.band();
-
-    kpoint_set_.clear();
-    kpoint_set_.add_kpoints(kpoints__, kpoint_weights__);
-    kpoint_set_.initialize();
-
     l_by_lm_.resize(parameters_.lmmax_rho());
     for (int l = 0, lm = 0; l <= parameters_.lmax_rho(); l++)
     {
         for (int m = -l; m <= l; m++, lm++) l_by_lm_[lm] = l;
     }
-}
-
-Density::~Density()
-{
-    delete rho_;
-    for (int j = 0; j < parameters_.num_mag_dims(); j++) delete magnetization_[j];
+
 }

 void Density::set_charge_density_ptr(double* rhomt, double* rhoir)
@@ -880,6 +898,97 @@
     }
 }

+void Density::generate_valence_density_mt_sht()
+{
+    Timer t("sirius::Density::generate_valence_density_mt_sht");
+
+    int lmax = (basis_type == apwlo) ? parameters_.lmax_apw() : parameters_.lmax_pw();
+    int lmmax = Utils::lmmax_by_lmax(lmax);
+
+    //std::vector<PeriodicFunction<double, radial_angular>*> dens(1 + parameters_.num_mag_dims());
+    //for (int i = 0; i < (int)dens.size(); i++)
+    //{
+    //    dens[i] = new PeriodicFunction<double, radial_angular>(parameters_, parameters_.lmax_rho());
+    //    dens[i]->allocate(rlm_component);
+    //    dens[i]->zero();
+    //}
+
+    SHT sht;
+    sht.set_lmax(parameters_.lmax_rho());
+
+
+    mdarray<complex16, 3> fylm(parameters_.max_num_mt_points(), lmmax, parameters_.num_atoms());
+    mdarray<complex16, 2> gylm(parameters_.lmmax_rho(), parameters_.max_num_mt_points());
+    mdarray<complex16, 2> gtp(sht.num_points(), parameters_.max_num_mt_points());
+    mdarray<double, 3> rhotp(sht.num_points(), parameters_.max_num_mt_points(), parameters_.num_atoms());
+    rhotp.zero();
+
+    mdarray<double, 3> rholm(parameters_.lmmax_rho(), parameters_.max_num_mt_points(), parameters_.num_atoms());
+    rholm.zero();
+
+    // add k-point contribution
+    for (int ikloc = 0; ikloc < kpoint_set_.spl_num_kpoints().local_size(); ikloc++)
+    {
+        int ik = kpoint_set_.spl_num_kpoints(ikloc);
+        for (int jloc = 0; jloc < band_->spl_spinor_wf_col().local_size(); jloc++)
+        {
+            int j = band_->spl_spinor_wf_col(jloc);
+
+            double wo = kpoint_set_[ik]->band_occupancy(j) * kpoint_set_[ik]->weight();
+
+            if (wo > 1e-14)
+            {
+                int ispn = 0;
+
+                kpoint_set_[ik]->spinor_wave_function_component_mt<radial_angular>(band_, lmax, ispn, jloc, fylm);
+                for (int ia = 0; ia < parameters_.num_atoms(); ia++)
+                {
+                    for (int lm = 0; lm < parameters_.lmmax_rho(); lm++)
+                    {
+                        for (int ir = 0; ir < parameters_.atom(ia)->num_mt_points(); ir++)
+                            gylm(lm, ir) = fylm(ir, lm, ia);
+                    }
+                    sht.ylm_backward_transform(&gylm(0, 0), parameters_.lmmax_rho(), parameters_.atom(ia)->num_mt_points(),
+                                               &gtp(0, 0));
+                    for (int ir = 0; ir < parameters_.atom(ia)->num_mt_points(); ir++)
+                    {
+                        for (int itp = 0; itp < sht.num_points(); itp++)
+                            rhotp(itp, ir, ia) += wo * pow(abs(gtp(itp, ir)), 2);
+                    }
+                }
+            }
+        }
+    }
+
+    for (int ia = 0; ia < parameters_.num_atoms(); ia++)
+    {
+        sht.rlm_forward_transform(&rhotp(0, 0, ia), parameters_.lmmax_rho(),parameters_.atom(ia)->num_mt_points(),
+                                  &rholm(0, 0, ia));
+    }
+
+    //for (int i = 0; i < (int)dens.size(); i++)
+   // {
+        for (int ia = 0; ia < parameters_.num_atoms(); ia++)
+        {
+            Platform::allreduce(&rholm(0, 0, ia),
+                                parameters_.lmmax_rho() * parameters_.max_num_mt_points(),
+                                parameters_.mpi_grid().communicator());
+        }
+    //}
+
+    for (int ia = 0; ia < parameters_.num_atoms(); ia++)
+    {
+        for (int ir = 0; ir < parameters_.atom(ia)->num_mt_points(); ir++)
+        {
+            for (int lm = 0; lm < parameters_.lmmax_rho(); lm++)
+            {
+                rho_->f_rlm(lm, ir, ia) = rholm(lm, ir, ia);
+            }
+        }
+    }
+}
+
+
 #ifdef _GPU_
 template<> void Density::generate_valence_density_mt_directly<gpu>()
 {
@@ -1047,12 +1156,12 @@
 {
     Timer t("sirius::Density::find_eigen_states");

+    potential_->update_atomic_potential();
+
     // generate radial functions
-    potential_->set_spherical_potential();
     parameters_.generate_radial_functions();

     // generate radial integrals
-    potential_->set_nonspherical_potential();
     parameters_.generate_radial_integrals();

     potential_->generate_pw_coefs();
@@ -1212,6 +1321,7 @@
         case apwlo:
         {
             generate_valence_density_mt();
+            //generate_valence_density_mt_sht();
             break;
         }
         case pwlo:


Code cleanup

Code cleanup

--- src/desktop.c
+++ src/desktop.c
@@ -240,7 +240,7 @@
 	desktop->prefs.icons = DESKTOP_ICONS_FILES;
 	desktop->prefs.monitor = -1;
 	if(prefs != NULL)
-		memcpy(&desktop->prefs, prefs, sizeof(*prefs));
+		desktop->prefs = *prefs;
 	desktop->font = NULL;
 	/* workarea */
 	desktop->screen = gdk_screen_get_default();


libcompat: remove ; from #defines

libcompat: remove ; from #defines

git-svn-id: caee63afe878fe2ec7dbba394a86c9654d9110ca@1000 64e312b2-a51f-0410-8e61-82d0ca0eb02a

--- lib/libcompat.h
+++ lib/libcompat.h
@@ -93,7 +93,7 @@
 #endif /* !HAVE_REALLOC */

 #if !HAVE_GETPID && HAVE__GETPID
-#define getpid _getpid;
+#define getpid _getpid
 #endif /* !HAVE_GETPID && HAVE__GETPID */

 #if !HAVE_GETTIMEOFDAY
@@ -109,7 +109,7 @@
 #if !HAVE_DECL_STRDUP && !HAVE__STRDUP
 CK_DLL_EXP char *strdup (const char *str);
 #elif !HAVE_DECL_STRDUP && HAVE__STRDUP
-#define strdup _strdup;
+#define strdup _strdup
 #endif /* !HAVE_DECL_STRDUP && HAVE__STRDUP */

 #if !HAVE_DECL_STRSIGNAL


added error checking to lputil_memdup

added error checking to lputil_memdup

--- lib/liblputil.c
+++ lib/liblputil.c
@@ -98,6 +98,11 @@
      size_t len = 10;
      int i, j;

+     if ( s == NULL || delim == NULL) {
+          errno = EINVAL;
+          return NULL;
+     }
+
      /* allocate len bytes on the heap and assign a pointer to that to that
       * region r */
      if ( (r = malloc(sizeof(char *)*len)) == NULL )