Set HTP_INVALID_CHUNKING when T-E contains anything but "chunked".

--- htp/htp_transaction.c
+++ htp/htp_transaction.c
@@ -372,22 +372,22 @@
 }

 static htp_status_t htp_tx_process_request_headers(htp_tx_t *tx) {
-    // Remember how many header lines there were before trailers
+    // Remember how many header lines there were before trailers.
     tx->request_header_lines_no_trailers = htp_list_size(tx->request_header_lines);

-    // Determine if we have a request body, and how it is packaged
+    // Determine if we have a request body, and how it is packaged.
     htp_header_t *cl = htp_table_get_c(tx->request_headers, "content-length");
     htp_header_t *te = htp_table_get_c(tx->request_headers, "transfer-encoding");

-    // Check for the Transfer-Encoding header, which would indicate a chunked request body
+    // Check for the Transfer-Encoding header, which would indicate a chunked request body.
     if (te != NULL) {
-        // Make sure it contains "chunked" only
+        // Make sure it contains "chunked" only.
         if (bstr_cmp_c(te->value, "chunked") != 0) {
-            // Invalid T-E header value
+            // Invalid T-E header value.
+            tx->flags |= HTP_INVALID_CHUNKING;
+
             htp_log(tx->connp, HTP_LOG_MARK, HTP_LOG_ERROR, 0,
                     "Invalid T-E value in request");
-
-            // TODO Should this be a fatal error?
         }

         // Chunked encoding is a HTTP/1.1 feature. Check that some other protocol is not
@@ -402,7 +402,7 @@
         // If the T-E header is present we are going to use it.
         tx->request_transfer_coding = HTP_CODING_CHUNKED;

-        // We are still going to check for the presence of C-L
+        // We are still going to check for the presence of C-L.
         if (cl != NULL) {
             // This is a violation of the RFC
             tx->flags |= HTP_REQUEST_SMUGGLING;
@@ -411,17 +411,17 @@
         // We have a request body of known length
         tx->request_transfer_coding = HTP_CODING_IDENTITY;

-        // Check for a folded C-L header
+        // Check for a folded C-L header.
         if (cl->flags & HTP_FIELD_FOLDED) {
             tx->flags |= HTP_REQUEST_SMUGGLING;
         }

-        // Check for multiple C-L headers
+        // Check for multiple C-L headers.
         if (cl->flags & HTP_FIELD_REPEATED) {
             tx->flags |= HTP_REQUEST_SMUGGLING;
         }

-        // Get body length
+        // Get body length.
         int i = htp_parse_content_length(cl->value);
         if (i < 0) {
             htp_log(tx->connp, HTP_LOG_MARK, HTP_LOG_ERROR, 0, "Invalid C-L field in request");


cso_context_destroy calls bind_state functions with NULL parameter

--- src/gallium/drivers/nv30/nv30_state.c
+++ src/gallium/drivers/nv30/nv30_state.c
@@ -39,6 +39,10 @@
 {
 	struct nv30_context *nv30 = nv30_context(pipe);
 	struct nv30_blend_state *cb = hwcso;
+
+	if (!hwcso) {
+		return;
+	}

 	BEGIN_RING(rankine, NV34TCL_DITHER_ENABLE, 1);
 	OUT_RING  (cb->d_enable);
@@ -236,6 +240,10 @@
 	struct nv30_context *nv30 = nv30_context(pipe);
 	unsigned unit;

+	if (!sampler) {
+		return;
+	}
+
 	for (unit = 0; unit < nr; unit++) {
 		nv30->tex_sampler[unit] = sampler[unit];
 		nv30->dirty_samplers |= (1 << unit);
@@ -346,6 +354,10 @@
 	struct nv30_context *nv30 = nv30_context(pipe);
 	struct nv30_rasterizer_state *rs = hwcso;

+	if (!hwcso) {
+		return;
+	}
+
 	BEGIN_RING(rankine, NV34TCL_SHADE_MODEL, 1);
 	OUT_RING  (rs->shade_model);

@@ -422,6 +434,10 @@
 	struct nv30_context *nv30 = nv30_context(pipe);
 	struct nv30_depth_stencil_alpha_state *hw = hwcso;

+	if (!hwcso) {
+		return;
+	}
+
 	BEGIN_RING(rankine, NV34TCL_DEPTH_FUNC, 3);
 	OUT_RINGp ((uint32_t *)&hw->depth, 3);
 	BEGIN_RING(rankine, NV34TCL_STENCIL_BACK_ENABLE, 16);
@@ -455,6 +471,10 @@
 	struct nv30_context *nv30 = nv30_context(pipe);
 	struct nv30_vertex_program *vp = hwcso;

+	if (!hwcso) {
+		return;
+	}
+
 	nv30->vertprog.current = vp;
 	nv30->dirty |= NV30_NEW_VERTPROG;
 }
@@ -486,6 +506,10 @@
 {
 	struct nv30_context *nv30 = nv30_context(pipe);
 	struct nv30_fragment_program *fp = hwcso;
+
+	if (!hwcso) {
+		return;
+	}

 	nv30->fragprog.current = fp;
 	nv30->dirty |= NV30_NEW_FRAGPROG;


[Dominators] Remove the NCA check

[Dominators] Remove the NCA check

Summary:
This patch removes the `verifyNCD` check.

The reason for this is that the other checks are sufficient to prove or disprove correctness of any DominatorTree, and that `verifyNCD` doesn't provide (in my option) better error messages then the other ones.
Additionally, this should give a (small) improvement to the total verification time, as the check is O(n), and checking the sibling property takes O(n^3).

Reviewers: dberlin, grosser, davide, brzycki

Reviewed By: brzycki

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38802

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

--- include/llvm/Support/GenericDomTreeConstruction.h
+++ include/llvm/Support/GenericDomTreeConstruction.h
@@ -1461,40 +1461,6 @@
     return true;
   }

-  // Checks if for every edge From -> To in the graph
-  //     NCD(From, To) == IDom(To) or To.
-  bool verifyNCD(const DomTreeT &DT) {
-    clear();
-    doFullDFSWalk(DT, AlwaysDescend);
-
-    for (auto &BlockToInfo : NodeToInfo) {
-      auto &Info = BlockToInfo.second;
-
-      const NodePtr From = NumToNode[Info.Parent];
-      if (!From) continue;
-
-      const NodePtr To = BlockToInfo.first;
-      const TreeNodePtr ToTN = DT.getNode(To);
-      assert(ToTN);
-
-      const NodePtr NCD = DT.findNearestCommonDominator(From, To);
-      const TreeNodePtr NCDTN = DT.getNode(NCD);
-      const TreeNodePtr ToIDom = ToTN->getIDom();
-      if (NCDTN != ToTN && NCDTN != ToIDom) {
-        errs() << "NearestCommonDominator verification failed:\n\tNCD(From:"
-               << BlockNamePrinter(From) << ", To:" << BlockNamePrinter(To)
-               << ") = " << BlockNamePrinter(NCD)
-               << ",\t (should be To or IDom[To]: " << BlockNamePrinter(ToIDom)
-               << ")\n";
-        errs().flush();
-
-        return false;
-      }
-    }
-
-    return true;
-  }
-
   // The below routines verify the correctness of the dominator tree relative to
   // the CFG it's coming from.  A tree is a dominator tree iff it has two
   // properties, called the parent property and the sibling property.  Tarjan
@@ -1632,9 +1598,8 @@
 bool Verify(const DomTreeT &DT) {
   SemiNCAInfo<DomTreeT> SNCA(nullptr);
   return SNCA.verifyRoots(DT) && SNCA.verifyReachability(DT) &&
-         SNCA.VerifyLevels(DT) && SNCA.verifyNCD(DT) &&
-         SNCA.verifyParentProperty(DT) && SNCA.verifySiblingProperty(DT) &&
-         SNCA.VerifyDFSNumbers(DT);
+         SNCA.VerifyLevels(DT) && SNCA.verifyParentProperty(DT) &&
+         SNCA.verifySiblingProperty(DT) && SNCA.VerifyDFSNumbers(DT);
 }

 }  // namespace DomTreeBuilder


fix printf (had an extra space) add useless comments to new Intel code

--- dev/pci/pciide.c
+++ dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/*      $OpenBSD: pciide.c,v 1.11 1999/10/09 03:42:04 csapuntz Exp $     */
+/*      $OpenBSD: pciide.c,v 1.12 1999/11/02 02:43:45 chris Exp $     */
 /*	$NetBSD: pciide.c,v 1.40 1999/07/12 13:49:38 bouyer Exp $	*/

 /*
@@ -230,11 +230,11 @@
 	  0,
 	  piix_chip_map
 	},
-	{ PCI_PRODUCT_INTEL_82801AA_IDE,
+	{ PCI_PRODUCT_INTEL_82801AA_IDE, /* Intel 82801AA IDE (ICH) */
 	  0,
 	  piix_chip_map,
 	},
-	{ PCI_PRODUCT_INTEL_82801AB_IDE,
+	{ PCI_PRODUCT_INTEL_82801AB_IDE, /* Intel 82801AB IDE (ICH0) */
 	  0,
 	  piix_chip_map,
 	},
@@ -1113,7 +1113,7 @@
 		} else {
 			pciide_mapreg_dma(sc, pa);
 		if (sc->sc_dma_ok != 0)
-			printf(", (partial support) ");
+			printf(", (partial support)");
 		}
 	} else {
 		printf(": no DMA");


trace: whitespace, comment clean-ups

trace: whitespace, comment clean-ups

--- src/gallium/drivers/trace/tr_screen.h
+++ src/gallium/drivers/trace/tr_screen.h
@@ -41,7 +41,7 @@
 /**
  * It often happens that new data is written directly to the user buffers
  * without mapping/unmapping. This flag marks user buffers, so that their
- * contents can be dumpped before being used by the pipe context.
+ * contents can be dumped before being used by the pipe context.
  */
 #define TRACE_FLAG_USER_BUFFER  (1 << 31)

@@ -54,13 +54,9 @@
 };

-/*
- * tr_screen.c
- */
-
-
 struct trace_screen *
 trace_screen(struct pipe_screen *screen);
+

 #ifdef __cplusplus
 }


changed debug so it always prints pid and cid in color

Original commit message from CVS:
changed debug so it always prints pid and cid in color

--- gst/gstinfo.c
+++ gst/gstinfo.c
@@ -280,7 +280,9 @@
   if (element && GST_IS_ELEMENT (element))
     elementname = g_strdup_printf (" \033[04m[%s]\033[00m", GST_OBJECT_NAME (element));

+/*
 #ifdef GST_DEBUG_ENABLED
+*/
   #ifdef GST_DEBUG_COLOR
     fprintf(stderr,"\033[01mINFO\033[00m (\033[00;%dm%5d\033[00m:\033[00;%dm%2d\033[00m)\033["
             GST_DEBUG_CHAR_MODE ";%sm%s%s\033[00m %s\n",
@@ -289,7 +291,8 @@
   #else
     fprintf(stderr,"INFO (%5d:%2d)%s%s %s\n",
             pthread_id,cothread_id,location,elementname,string);
-  #endif /* GST_DEBUG_COLOR */
+  #endif // GST_DEBUG_COLOR
+/*
 #else
   #ifdef GST_DEBUG_COLOR
     fprintf(stderr,"\033[01mINFO\033[00m:\033[" GST_DEBUG_CHAR_MODE ";%sm%s%s\033[00m %s\n",
@@ -297,8 +300,9 @@
   #else
     fprintf(stderr,"INFO:%s%s %s\n",
             location,elementname,string);
-  #endif /* GST_DEBUG_COLOR */
+  #endif // GST_DEBUG_COLOR
 #endif
+*/

   if (location != empty) g_free(location);
   if (elementname != empty) g_free(elementname);


Add support for SiS 1183 SATA. From/tested by Loganaden Velvindron.


Add DofMap::dof_owner() search

Add DofMap::dof_owner() search

This can be done without the current API, but I'd rather have a
short-to-invoke O(log N_procs) method available in libMesh, not force
users to write a longer O(N_procs) linear search or an even longer
(because we don't give raw access to the _end_dfs array) binary
search.

--- include/base/dof_map.h
+++ include/base/dof_map.h
@@ -578,6 +578,16 @@
   dof_id_type end_dof() const
   { return this->end_dof(this->processor_id()); }

+  /**
+   * \returns The processor id that owns the dof index \p dof
+   */
+  processor_id_type dof_owner(const dof_id_type dof) const
+  { std::vector<dof_id_type>::const_iterator ub =
+      std::upper_bound(_end_df.begin(), _end_df.end(), dof);
+    libmesh_assert (ub != _end_df.end());
+    return (ub - _end_df.begin());
+  }
+
 #ifdef LIBMESH_ENABLE_AMR
   /**
    * \returns The first old dof index that is after all indices local


vc4: Skip storing the Z/S contents when it's invalidated.

Improves framerate of 5 seconds of es2gears by 1.57473% +/- 0.669409%
(n=67).

Reviewed-by: Jose Fonseca <61b5a29db2c0650f7c8510f93eece059c1b09320@vmware.com>

--- src/gallium/drivers/vc4/vc4_context.c
+++ src/gallium/drivers/vc4/vc4_context.c
@@ -467,6 +467,16 @@
 }

 static void
+vc4_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
+{
+        struct vc4_context *vc4 = vc4_context(pctx);
+        struct pipe_surface *zsurf = vc4->framebuffer.zsbuf;
+
+        if (zsurf && zsurf->texture == prsc)
+                vc4->resolve &= ~(PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL);
+}
+
+static void
 vc4_context_destroy(struct pipe_context *pctx)
 {
         struct vc4_context *vc4 = vc4_context(pctx);
@@ -510,6 +520,7 @@
         pctx->priv = priv;
         pctx->destroy = vc4_context_destroy;
         pctx->flush = vc4_pipe_flush;
+        pctx->invalidate_resource = vc4_invalidate_resource;

         vc4_draw_init(pctx);
         vc4_state_init(pctx);


parse: be less picky regarding some reserved value

Signed-off-by: Felipe Contreras <de77a8b9cd239b204c19c52ed62e48ab47243362@gmail.com>

--- gstav_parse.c
+++ gstav_parse.c
@@ -526,8 +526,6 @@
 		if ((d & 0xfc) != 0xfc)
 			return FALSE;
 		d = get_bits(&s, 8);
-		if ((d & 0xe0) != 0xe0)
-			return FALSE;

 		/* number of SPS */
 		if ((d & 0x1f) == 0)


flow:composed:http: Fix wrong check

flow:composed:http: Fix wrong check

Signed-off-by: Flavio Ceolin <979b9165500b0741b9d0500e2efd74fc1547bff7@intel.com>

--- src/modules/flow-metatype/http-composed-client/http-composed-client.c
+++ src/modules/flow-metatype/http-composed-client/http-composed-client.c
@@ -1342,7 +1342,7 @@
     SOL_NULL_CHECK_GOTO(option->name, err);

     option->data_type = strdup("string");
-    SOL_NULL_CHECK_GOTO(option->name, err_data);
+    SOL_NULL_CHECK_GOTO(option->data_type, err_data);

     return 0;


- allow options parameter to be NULL

- allow options parameter to be NULL

--- http_request_object.c
+++ http_request_object.c
@@ -798,7 +798,7 @@
 	zval *options = NULL;

 	SET_EH_THROW_HTTP();
-	if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sla", &URL, &URL_len, &meth, &options)) {
+	if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sla!", &URL, &URL_len, &meth, &options)) {
 		if (URL) {
 			UPD_STRL(url, URL, URL_len);
 		}


widgets: render: Avoid abort() on initial call to render

Do not attempt to draw application if it's minial size is bigger than
our current backend pixmap. We will redraw it on resize ack right away
anyways and this avoids abort() check in gp_sub_pixmap() in certain
cases.

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

--- libs/widgets/gp_widget_render.c
+++ libs/widgets/gp_widget_render.c
@@ -367,9 +367,14 @@

 	gp_widget_calc_size(layout, &ctx, 0, 0, 1);

+	app_layout = layout;
+
 	gp_backend_resize(backend, layout->w, layout->h);

-	app_layout = layout;
+	if (gp_pixmap_w(backend->pixmap) < layout->w ||
+	    gp_pixmap_h(backend->pixmap) < layout->h) {
+		return;
+	}

 	int flag = 0;


implement RESULT

implement RESULT

--- iv/lv5/breaker/compiler.h
+++ iv/lv5/breaker/compiler.h
@@ -135,6 +135,9 @@
           break;
         case r::OP::RETURN:
           EmitRETURN(instr);
+          break;
+        case r::OP::RESULT:
+          EmitRESULT(instr);
           break;
         case r::OP::LOAD_CONST:
           EmitLOAD_CONST(instr);
@@ -563,7 +566,7 @@
     // So r13 is still callee Frame.
     const int16_t src = Reg(instr[1].i32[0]);
     asm_->mov(asm_->rax, asm_->ptr[asm_->r13 + src * kJSValSize]);
-    asm_->pop(asm_->rcx);
+    asm_->add(asm_->rsp, k64Size);
     asm_->ret();
   }

@@ -615,7 +618,7 @@
     {
       asm_->inLocalLabel();
       asm_->mov(asm_->rdi, asm_->r12);
-      asm_->mov(asm_->rsi, asm_->qword[asm_->r13 + callee * kJSValSize]);
+      asm_->mov(asm_->rsi, asm_->ptr[asm_->r13 + callee * kJSValSize]);
       asm_->lea(asm_->rdx, asm_->ptr[asm_->r13 + offset * kJSValSize]);
       asm_->mov(asm_->rcx, argc_with_this);
       asm_->mov(asm_->r8, asm_->rsp);


Update map.h

Update map.h

--- include/bikedemo/map.h
+++ include/bikedemo/map.h
@@ -26,7 +26,7 @@
  * balance allows for much faster insertions and del-
  * etions
  *
- * Copyright (C) 2006-2012, Russell Potter, All rights
+ * Copyright (C) 2006-2014, Russell Potter, All rights
  * reserved
  *
  ********************************************************************/


adds sorting of pivots for Prym-Green matrices

--- cli/gbla.c
+++ cli/gbla.c
@@ -250,7 +250,7 @@
     }
   }
   if (schreyer_matrix == 1) {
-    //M = sort_schreyer_matrix(M);
+    M = sort_schreyer_matrix(M);
     normalize_schreyer_input_rows(M);
     if (write_pbm) {
       if (verbose > 1) {


vc4: Refactor vertex attribute conversions a bit.

There was just way too much indentation.

--- src/gallium/drivers/vc4/vc4_program.c
+++ src/gallium/drivers/vc4/vc4_program.c
@@ -986,6 +986,43 @@
         return qir_SHL(c, src[0 * 4 + i], qir_uniform_ui(c, 4));
 }

+static struct qreg
+get_channel_from_vpm(struct vc4_compile *c,
+                     struct qreg *vpm_reads,
+                     uint8_t swiz,
+                     const struct util_format_description *desc)
+{
+        const struct util_format_channel_description *chan =
+                &desc->channel[swiz];
+        struct qreg temp;
+
+        if (swiz > UTIL_FORMAT_SWIZZLE_W)
+                return get_swizzled_channel(c, vpm_reads, swiz);
+        else if (chan->size == 32 &&
+                 chan->type == UTIL_FORMAT_TYPE_FLOAT) {
+                return get_swizzled_channel(c, vpm_reads, swiz);
+        } else if (chan->size == 8 &&
+                   (chan->type == UTIL_FORMAT_TYPE_UNSIGNED ||
+                    chan->type == UTIL_FORMAT_TYPE_SIGNED) &&
+                   chan->normalized) {
+                struct qreg vpm = vpm_reads[0];
+                if (chan->type == UTIL_FORMAT_TYPE_SIGNED)
+                        vpm = qir_XOR(c, vpm, qir_uniform_ui(c, 0x80808080));
+                temp = qir_UNPACK_8_F(c, vpm, swiz);
+
+                if (chan->type == UTIL_FORMAT_TYPE_SIGNED) {
+                        return qir_FSUB(c, qir_FMUL(c,
+                                                    temp,
+                                                    qir_uniform_f(c, 2.0)),
+                                        qir_uniform_f(c, 1.0));
+                } else {
+                        return temp;
+                }
+        } else {
+                return c->undef;
+        }
+}
+
 static void
 emit_vertex_input(struct vc4_compile *c, int attr)
 {
@@ -1010,22 +1047,10 @@

         for (int i = 0; i < 4; i++) {
                 uint8_t swiz = desc->swizzle[i];
-                struct qreg result;
-
-                if (swiz > UTIL_FORMAT_SWIZZLE_W)
-                        result = get_swizzled_channel(c, vpm_reads, swiz);
-                else if (desc->channel[swiz].size == 32 &&
-                         desc->channel[swiz].type == UTIL_FORMAT_TYPE_FLOAT) {
-                        result = get_swizzled_channel(c, vpm_reads, swiz);
-                } else if (desc->channel[swiz].size == 8 &&
-                           (desc->channel[swiz].type == UTIL_FORMAT_TYPE_UNSIGNED ||
-                            desc->channel[swiz].type == UTIL_FORMAT_TYPE_SIGNED) &&
-                           desc->channel[swiz].normalized) {
-                        struct qreg vpm = vpm_reads[0];
-                        if (desc->channel[swiz].type == UTIL_FORMAT_TYPE_SIGNED)
-                                vpm = qir_XOR(c, vpm, qir_uniform_ui(c, 0x80808080));
-                        result = qir_UNPACK_8_F(c, vpm, swiz);
-                } else {
+                struct qreg result = get_channel_from_vpm(c, vpm_reads,
+                                                          swiz, desc);
+
+                if (result.file == QFILE_NULL) {
                         if (!format_warned) {
                                 fprintf(stderr,
                                         "vtx element %d unsupported type: %s\n",
@@ -1034,16 +1059,6 @@
                         }
                         result = qir_uniform_f(c, 0.0);
                 }
-
-                if (desc->channel[swiz].normalized &&
-                    desc->channel[swiz].type == UTIL_FORMAT_TYPE_SIGNED) {
-                        result = qir_FSUB(c,
-                                          qir_FMUL(c,
-                                                   result,
-                                                   qir_uniform_f(c, 2.0)),
-                                          qir_uniform_f(c, 1.0));
-                }
-
                 c->inputs[attr * 4 + i] = result;
         }
 }


r300/compiler: Fix magic numbers in readmasks.

--- src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
+++ src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c
@@ -412,15 +412,15 @@
 			srcmasks[0] |= RC_MASK_XYZW;
 			break;
 		case RC_OPCODE_DST:
-			srcmasks[0] |= 0x6;
-			srcmasks[1] |= 0xa;
+			srcmasks[0] |= RC_MASK_Y | RC_MASK_Z;
+			srcmasks[1] |= RC_MASK_Y | RC_MASK_W;
 			break;
 		case RC_OPCODE_EXP:
 		case RC_OPCODE_LOG:
 			srcmasks[0] |= RC_MASK_XY;
 			break;
 		case RC_OPCODE_LIT:
-			srcmasks[0] |= 0xb;
+			srcmasks[0] |= RC_MASK_X | RC_MASK_Y | RC_MASK_W;
 			break;
 		default:
 			break;


Create guitutorial.h

Create guitutorial.h

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

--- guitutorial.h
+++ guitutorial.h
@@ -0,0 +1,37 @@
+#ifndef GUITUTORIAL_H
+#define GUITUTORIAL_H
+
+#include <QDialog>
+#include "ui_guitutorial.h"
+
+class GoToCellDialog: public QDialog, public Ui::GoToCellDialog
+{
+    Q_OBJECT
+public:
+    GoToCellDialog(QWidget *parent = 0);
+private slots:
+    void on_lineEdit_textChanged();
+};
+
+
+
+
+/*#include <QWidget>
+
+namespace Ui {
+class GUITutorial;
+}
+
+class GUITutorial : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit GUITutorial(QWidget *parent = 0);
+    ~GUITutorial();
+
+private:
+    Ui::GUITutorial *ui;
+};*/
+
+#endif // GUITUTORIAL_H


In uaudio_detach(), check that sc->sc_alts is not NULL before
using it.  This could happen if uaudio_attach() failed, for
instance because the device has no valid audio stream interface.
Certain MIDI devices expose such descriptors.

ok jakemsr@

--- dev/usb/uaudio.c
+++ dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: uaudio.c,v 1.70 2009/11/26 15:45:25 jakemsr Exp $ */
+/*	$OpenBSD: uaudio.c,v 1.71 2009/12/04 08:17:39 ratchov Exp $ */
 /*	$NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $	*/

 /*
@@ -490,6 +490,12 @@
 	struct chan *pchan = &sc->sc_playchan;
 	struct chan *rchan = &sc->sc_recchan;
 	int ms, rv = 0;
+
+	/*
+	 * sc_alts may be NULL if uaudio_identify_as() failed
+	 */
+	if (sc->sc_alts == NULL)
+		return rv;

 	/* Wait for outstanding requests to complete. */
 	ms = max(sc->sc_alts[pchan->altidx].sc_busy ? pchan->reqms : 0,


ISSUE #340 more friends

ISSUE #340 more friends

--- bouncer/src/repo/core/model/bson/repo_bson_element.h
+++ bouncer/src/repo/core/model/bson/repo_bson_element.h
@@ -32,6 +32,9 @@
 #include "../../../lib/repo_log.h"
 namespace repo {
 	namespace core {
+		namespace handler {
+			class MongoDatabaseHandler;
+		}
 		namespace model {
 			//type of element
 			enum class REPO_API_EXPORT ElementType{
@@ -43,6 +46,7 @@
 			{
 				friend class RepoBSONBuilder;
 				friend class RepoBSON;
+				friend class repo::core::handler::MongoDatabaseHandler;
 			public:

 				/**


Cleanup.

Cleanup.

--- include/bx/float4_ni.h
+++ include/bx/float4_ni.h
@@ -38,14 +38,6 @@
 	{
 		const float4_t mul    = float4_mul(_a, _b);
 		const float4_t result = float4_sub(_c, mul);
-
-		return result;
-	}
-
-	BX_FLOAT4_INLINE float4_t float4_rcp_ni(float4_t _a)
-	{
-		const float4_t one    = float4_splat(1.0f);
-		const float4_t result = float4_div(one, _a);

 		return result;
 	}
@@ -57,6 +49,14 @@
 		const float4_t iter0   = float4_mul(_a, est);
 		const float4_t tmp1    = float4_nmsub(_b, est, oneish);
 		const float4_t result  = float4_madd(tmp1, iter0, iter0);
+
+		return result;
+	}
+
+	BX_FLOAT4_INLINE float4_t float4_rcp_ni(float4_t _a)
+	{
+		const float4_t one    = float4_splat(1.0f);
+		const float4_t result = float4_div(one, _a);

 		return result;
 	}


Only download files not already downloaded

Make HEAD request before downloading anything

--- libsummer/summer-download-web.c
+++ libsummer/summer-download-web.c
@@ -104,10 +104,55 @@
 	g_object_unref (self);
 }

-static void
-start (SummerDownload *self)
-{
-	g_return_if_fail (SUMMER_IS_DOWNLOAD_WEB (self));
+static gboolean
+is_downloaded (gchar *filename, gsize reported_size)
+{
+	if (!filename)
+		return FALSE;
+	GFile *file = g_file_new_for_path (filename);
+	if (g_file_query_exists (file, NULL)) {
+		GError *e = NULL;
+		GFileInfo *info = g_file_query_info (file,
+			G_FILE_ATTRIBUTE_STANDARD_SIZE,
+			G_FILE_QUERY_INFO_NONE,
+			NULL,
+			&e);
+		if (e) {
+			g_warning ("Error when checking filesize: %s", e->message);
+			g_clear_error (&e);
+			g_object_unref (file);
+			return FALSE;
+		}
+		guint64 current_size = g_file_info_get_attribute_uint64 (info,
+			G_FILE_ATTRIBUTE_STANDARD_SIZE);
+		// If reported_size is 0, assume the file is downloaded
+		if (current_size && (!reported_size || current_size == reported_size)) {
+			summer_debug ("File %s already exists - not downloading", filename);
+			g_object_unref (info);
+			g_object_unref (file);
+			return TRUE;
+		} else {
+			summer_debug ("Removing old copy of %s since it doesn't has the right size (is %i, should be %i)", filename, current_size, reported_size);
+			g_file_delete (file, NULL, &e);
+			if (e) {
+				g_warning ("Error when deleting file: %s", e->message);
+				g_clear_error (&e);
+			}
+			g_object_unref (info);
+			g_object_unref (file);
+			return FALSE;
+		}
+	}
+	g_object_unref (file);
+	return FALSE;
+}
+
+static void
+on_headers_parsed (SummerWebBackend *web, gpointer user_data)
+{
+	g_return_if_fail (SUMMER_IS_DOWNLOAD_WEB (user_data));
+	g_return_if_fail (SUMMER_IS_WEB_BACKEND (web));
+	SummerDownload *self = SUMMER_DOWNLOAD (user_data);
 	SummerDownloadWebPrivate *priv = SUMMER_DOWNLOAD_WEB (self)->priv;

 	gchar *filename, *save_dir;
@@ -124,8 +169,24 @@
 	summer_debug ("Downloading from %s to %s via %s\n", url, save_dir, tmp_dir);
 	g_free (url);
 	g_free (tmp_dir);
+
+	if (is_downloaded (final_path, length)) {
+		g_signal_emit_by_name (self, "download-complete", final_path);
+	} else {
+		summer_web_backend_fetch (priv->web);
+	}
+
 	g_free (save_dir);
-	summer_web_backend_fetch (priv->web);
+	g_free (final_path);
+}
+
+static void
+start (SummerDownload *self)
+{
+	g_return_if_fail (SUMMER_IS_DOWNLOAD_WEB (self));
+	SummerDownloadWebPrivate *priv = SUMMER_DOWNLOAD_WEB (self)->priv;
+	g_signal_connect (priv->web, "headers-parsed", G_CALLBACK (on_headers_parsed), self);
+	summer_web_backend_fetch_head (priv->web);
 }

 static GObject *


sh: Reindent evaltree().

sh: Reindent evaltree().

--- bin/sh/eval.c
+++ bin/sh/eval.c
@@ -205,86 +205,86 @@
 		goto out;
 	}
 	do {
-	next = NULL;
+		next = NULL;
 #ifndef NO_HISTORY
-	displayhist = 1;	/* show history substitutions done with fc */
+		displayhist = 1;	/* show history substitutions done with fc */
 #endif
-	TRACE(("evaltree(%p: %d) called\n", (void *)n, n->type));
-	switch (n->type) {
-	case NSEMI:
-		evaltree(n->nbinary.ch1, flags & ~EV_EXIT);
-		if (evalskip)
-			goto out;
-		next = n->nbinary.ch2;
-		break;
-	case NAND:
-		evaltree(n->nbinary.ch1, EV_TESTED);
-		if (evalskip || exitstatus != 0) {
-			goto out;
-		}
-		next = n->nbinary.ch2;
-		break;
-	case NOR:
-		evaltree(n->nbinary.ch1, EV_TESTED);
-		if (evalskip || exitstatus == 0)
-			goto out;
-		next = n->nbinary.ch2;
-		break;
-	case NREDIR:
-		evalredir(n, flags);
-		break;
-	case NSUBSHELL:
-		evalsubshell(n, flags);
-		do_etest = !(flags & EV_TESTED);
-		break;
-	case NBACKGND:
-		evalsubshell(n, flags);
-		break;
-	case NIF: {
-		evaltree(n->nif.test, EV_TESTED);
-		if (evalskip)
-			goto out;
-		if (exitstatus == 0)
-			next = n->nif.ifpart;
-		else if (n->nif.elsepart)
-			next = n->nif.elsepart;
-		else
+		TRACE(("evaltree(%p: %d) called\n", (void *)n, n->type));
+		switch (n->type) {
+		case NSEMI:
+			evaltree(n->nbinary.ch1, flags & ~EV_EXIT);
+			if (evalskip)
+				goto out;
+			next = n->nbinary.ch2;
+			break;
+		case NAND:
+			evaltree(n->nbinary.ch1, EV_TESTED);
+			if (evalskip || exitstatus != 0) {
+				goto out;
+			}
+			next = n->nbinary.ch2;
+			break;
+		case NOR:
+			evaltree(n->nbinary.ch1, EV_TESTED);
+			if (evalskip || exitstatus == 0)
+				goto out;
+			next = n->nbinary.ch2;
+			break;
+		case NREDIR:
+			evalredir(n, flags);
+			break;
+		case NSUBSHELL:
+			evalsubshell(n, flags);
+			do_etest = !(flags & EV_TESTED);
+			break;
+		case NBACKGND:
+			evalsubshell(n, flags);
+			break;
+		case NIF: {
+			evaltree(n->nif.test, EV_TESTED);
+			if (evalskip)
+				goto out;
+			if (exitstatus == 0)
+				next = n->nif.ifpart;
+			else if (n->nif.elsepart)
+				next = n->nif.elsepart;
+			else
+				exitstatus = 0;
+			break;
+		}
+		case NWHILE:
+		case NUNTIL:
+			evalloop(n, flags & ~EV_EXIT);
+			break;
+		case NFOR:
+			evalfor(n, flags & ~EV_EXIT);
+			break;
+		case NCASE:
+			evalcase(n, flags);
+			break;
+		case NDEFUN:
+			defun(n->narg.text, n->narg.next);
 			exitstatus = 0;
-		break;
-	}
-	case NWHILE:
-	case NUNTIL:
-		evalloop(n, flags & ~EV_EXIT);
-		break;
-	case NFOR:
-		evalfor(n, flags & ~EV_EXIT);
-		break;
-	case NCASE:
-		evalcase(n, flags);
-		break;
-	case NDEFUN:
-		defun(n->narg.text, n->narg.next);
-		exitstatus = 0;
-		break;
-	case NNOT:
-		evaltree(n->nnot.com, EV_TESTED);
-		exitstatus = !exitstatus;
-		break;
-
-	case NPIPE:
-		evalpipe(n);
-		do_etest = !(flags & EV_TESTED);
-		break;
-	case NCMD:
-		evalcommand(n, flags, (struct backcmd *)NULL);
-		do_etest = !(flags & EV_TESTED);
-		break;
-	default:
-		out1fmt("Node type = %d\n", n->type);
-		flushout(&output);
-		break;
-	}
-	n = next;
+			break;
+		case NNOT:
+			evaltree(n->nnot.com, EV_TESTED);
+			exitstatus = !exitstatus;
+			break;
+
+		case NPIPE:
+			evalpipe(n);
+			do_etest = !(flags & EV_TESTED);
+			break;
+		case NCMD:
+			evalcommand(n, flags, (struct backcmd *)NULL);
+			do_etest = !(flags & EV_TESTED);
+			break;
+		default:
+			out1fmt("Node type = %d\n", n->type);
+			flushout(&output);
+			break;
+		}
+		n = next;
 	} while (n != NULL);
 out:
 	if (pendingsigs)


fix LHS Assignment part 2

fix LHS Assignment part 2

--- iv/lv5/railgun/compiler.h
+++ iv/lv5/railgun/compiler.h
@@ -1140,7 +1140,9 @@

       if (!lhs.IsValidLeftHandSide()) {
         lhs.Accept(this);
-        Emit<OP::TO_NUMBER_AND_RAISE_REFERENCE>();
+        rhs.Accept(this);
+        Emit<OP::RAISE_REFERENCE>();
+        stack_depth_.Down();
         return;
       }

@@ -1924,7 +1926,9 @@
   void EmitAssign(const Expression& lhs, const Expression& rhs) {
     if (!lhs.IsValidLeftHandSide()) {
       lhs.Accept(this);
+      rhs.Accept(this);
       Emit<OP::RAISE_REFERENCE>();
+      stack_depth_.Down();
       return;
     }


Split filter parser in two; kept I/O here, but moved fill_filter_set into library.

(Logical change 1.487)

--- setools/relabelanalysis/relabel_analysis_tool.c
+++ setools/relabelanalysis/relabel_analysis_tool.c
@@ -58,26 +58,10 @@
 	}
 };

-int find_obj_in_array(obj_perm_set_t *perm_sets, int num_perm_sets, int obj_idx)
-{
-	int i;
-
-	if (!perm_sets) return -1;
-	if (obj_idx < 0) return -1;
-
-	for (i = 0; i < num_perm_sets; i++) {
-		if (perm_sets[i].obj_class == obj_idx) {
-			return i;
-		}
-	}
-
-	return NOTHERE;
-};
-
-int apol_fill_filter_sets(FILE *infile, relabel_filter_t *filter, policy_t *policy)
+int apol_parse_filter_file(FILE *infile, relabel_filter_t *filter, policy_t *policy)
 {
         char str [300], *object, *perm, *s;
-        int obj_idx, perm_idx, retv = 0;
+        int retv;

         if (!infile){
                 fprintf(stderr, "bad filter file\n");
@@ -122,52 +106,17 @@
                         }
                 }

-
                 /* double check that something remains for both object
                  * and permission */
                 if (strlen (object) == 0 || strlen (perm) == 0) {
                         fprintf(stderr,"BAKA!\n");
                         return -42;
                 }
-                obj_idx = get_obj_class_idx(object, policy);
-                if (*perm == '*')
-                        perm_idx = -2;
-                else
-                        perm_idx = get_perm_idx(perm, policy);
-
-                if (!is_valid_obj_class_idx(obj_idx, policy) )
-                        return -1;
-                if (perm_idx >= 0) {
-                        if (!(is_valid_perm_idx(perm_idx, policy) && is_valid_perm_for_obj_class(policy, obj_idx, perm_idx)))
-                                return -1;
-                } else {
-                        if (perm_idx != -2)
-                                return -1;
-                }
-                if (filter->perm_sets)
-                        retv = find_obj_in_array(filter->perm_sets, filter->num_perm_sets, obj_idx);
-                if (retv == NOTHERE) {
-                        retv = apol_add_class_to_obj_perm_set_list(&(filter->perm_sets), &(filter->num_perm_sets), obj_idx);
-                        if (retv == -1)
-                                return -1;
-                } else if (retv < 0) {
+
+                retv = apol_fill_filter_set (object, perm, filter, policy);
+                if (retv)
                         return retv;
-                }
-
-		if (perm_idx >= 0) {
-			retv = apol_add_perm_to_obj_perm_set_list(&(filter->perm_sets), &(filter->num_perm_sets), obj_idx, perm_idx);
-			if (retv == -1)
-				return -1;
-		} else {
-			retv = find_obj_in_array(filter->perm_sets, filter->num_perm_sets, obj_idx);
-			if (filter->perm_sets[retv].perms) {
-				free(filter->perm_sets[retv].perms);
-				filter->perm_sets[retv].perms = NULL;
-			}
-			filter->perm_sets[retv].num_perms = 0;
-		}
-	}
-
+        }
 	return 0;
 };

@@ -441,7 +390,7 @@
 	}

 	if (filter_filename) {
-		retv = apol_fill_filter_sets(filter_file, filter, policy);
+		retv = apol_parse_filter_file(filter_file, filter, policy);
 		if (retv) {
 			fprintf(stderr,"fill filter sets error %i\n", retv);
  			return retv;


Print local partition in the status command.

--- cli/main.c
+++ cli/main.c
@@ -128,8 +128,12 @@
 	for (p = 0; p < ret; p++) {
 		struct switchtec_status *s = &status[p];

-		if (s->partition != last_partition)
-			printf("Partition %d:\n", s->partition);
+		if (s->partition != last_partition) {
+			const char *local = "";
+			if (s->partition == switchtec_partition(cfg.dev))
+				local = "    (LOCAL)";
+			printf("Partition %d:%s\n", s->partition, local);
+		}
 		last_partition = s->partition;

 		printf("      Stack %d, Port %d (%s): \n", s->stack,


targets/nine: remove unused static functions

Dead code since commit 8f50614910c40366d94964fe2c5da5772aff2f96

Cc: Axel Davy <2b6ef604b998fb81662f85c329e4fc020eae8e5d@ens.fr>
Cc: Tiziano Bacocco <2a82869f7317db18254323fa12ab4a27cc39e639@gmail.com>
Signed-off-by: Emil Velikov <4c996f2f093ddd0585a556460b4cc3ba555546ef@gmail.com>
Acked-by: Rob Clark <6f78cdb10adbe0a7fbbf4098125a51f401c77a5f@freedesktop.org>

--- src/gallium/targets/d3dadapter9/drm.c
+++ src/gallium/targets/d3dadapter9/drm.c
@@ -100,42 +100,6 @@
     FREE(ctx);
 }

-/* read a DWORD in the form 0xnnnnnnnn, which is how sysfs pci id stuff is
- * formatted. */
-static inline DWORD
-read_file_dword( const char *name )
-{
-    char buf[32];
-    int fd, r;
-
-    fd = open(name, O_RDONLY);
-    if (fd < 0) {
-        DBG("Unable to get PCI information from `%s'\n", name);
-        return 0;
-    }
-
-    r = read(fd, buf, 32);
-    close(fd);
-
-    return (r > 0) ? (DWORD)strtol(buf, NULL, 0) : 0;
-}
-
-/* sysfs doesn't expose the revision as its own file, so this function grabs a
- * dword at an offset in the raw PCI header. The reason this isn't used for all
- * data is that the kernel will make corrections but not expose them in the raw
- * header bytes. */
-static inline DWORD
-read_config_dword( int fd,
-                   unsigned offset )
-{
-    DWORD r = 0;
-
-    if (lseek(fd, offset, SEEK_SET) != offset) { return 0; }
-    if (read(fd, &r, 4) != 4) { return 0; }
-
-    return r;
-}
-
 static inline void
 get_bus_info( int fd,
               DWORD *vendorid,


Sort functions.

Sort functions.

--- dev/usb/uvideo.c
+++ dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: uvideo.c,v 1.29 2008/06/09 20:51:31 mglocker Exp $ */
+/*	$OpenBSD: uvideo.c,v 1.30 2008/06/10 06:08:22 mglocker Exp $ */

 /*
  * Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -146,11 +146,11 @@
 int		uvideo_dqbuf(void *, struct v4l2_buffer *);
 int		uvideo_streamon(void *, int);
 int		uvideo_try_fmt(void *, struct v4l2_format *);
-caddr_t		uvideo_mappage(void *, off_t, int);

 /*
  * Other hardware interface related functions
  */
+caddr_t		uvideo_mappage(void *, off_t, int);
 int		uvideo_get_bufsize(void *);
 void		uvideo_start_read(void *);

@@ -1945,6 +1945,20 @@
 	return (0);
 }

+caddr_t
+uvideo_mappage(void *v, off_t off, int prot)
+{
+	struct uvideo_softc *sc = v;
+	caddr_t p;
+
+	if (!sc->sc_mmap_flag)
+		sc->sc_mmap_flag = 1;
+
+	p = sc->sc_mmap_buffer + off;
+
+	return (p);
+}
+
 int
 uvideo_get_bufsize(void *v)
 {
@@ -1963,17 +1977,3 @@

 	uvideo_vs_start(sc);
 }
-
-caddr_t
-uvideo_mappage(void *v, off_t off, int prot)
-{
-	struct uvideo_softc *sc = v;
-	caddr_t p;
-
-	if (!sc->sc_mmap_flag)
-		sc->sc_mmap_flag = 1;
-
-	p = sc->sc_mmap_buffer + off;
-
-	return (p);
-}


export.h: Added

export.h: Added

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

--- include/click/export.h
+++ include/click/export.h
@@ -0,0 +1,18 @@
+/**
+ * @file export.h
+ * @author Michal Tusnio
+ * @date 2016
+ * @copyright 3-clause BSD
+ */
+
+
+#ifndef H_EXPORT
+#define H_EXPORT
+
+
+/* Those defines are only for LMC & LMCIoT compatibility which helps us get rid of extra patches
+   that just remove export.h & export macros */
+
+#define LETMECREATE_CLICK_EXPORT
+
+#endif


zdsfs: Direct --help and --version output to stdout

zdsfs writes output for --help and --version to stderr. This is
likely because zdsfs calls into a FUSE function for additional
usage output that also writes to stderr (prior to FUSE 3.0.0).

To be consistent with other s390-tools and GNU coding guide lines,
fix this by using stdout for zdsfs generated output, and by
redirecting stderr to stdout before calling the FUSE function.

Reviewed-by: Hendrik Brueckner <ea0a2d16c17dd61debc108adbc0ac849646dd099@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <e296756d5edaffcdbc7b9904859492ff25d3fce5@linux.ibm.com>
Signed-off-by: Jan Höppner <96138615ab4af0813785fa10d283f3d37eca3b78@linux.ibm.com>

--- zdsfs/zdsfs.c
+++ zdsfs/zdsfs.c
@@ -774,7 +774,7 @@

 static void usage(const char *progname)
 {
-	fprintf(stderr,
+	fprintf(stdout,
 "Usage: %s <devices> <mountpoint> [<options>]\n"
 "\n"
 "Use the zdsfs command to provide read access to data sets stored on one or\n"
@@ -976,14 +976,24 @@
 		return 0;
 	case KEY_HELP:
 		usage(outargs->argv[0]);
+
+		/*
+		 * Usage output needs to go to stdout to be consistent with
+		 * coding guidelines. FUSE versions before 3.0.0 print help
+		 * output to stderr. Redirect stderr to stdout here to enforce
+		 * consistent behavior.
+		 */
+		fflush(stderr);
+		dup2(STDOUT_FILENO, STDERR_FILENO);
+
 		fuse_opt_add_arg(outargs, "-ho");
 		/* call fuse_main to let library print fuse options */
 		fuse_main(outargs->argc, outargs->argv, &rdf_oper, NULL);
 		exit(0);
 	case KEY_VERSION:
-		fprintf(stderr, COMP "FUSE file system for z/OS data set access"
+		fprintf(stdout, COMP "FUSE file system for z/OS data set access"
 			", program version %s\n", RELEASE_STRING);
-		fprintf(stderr, "Copyright IBM Corp. 2013, 2017\n");
+		fprintf(stdout, "Copyright IBM Corp. 2013, 2017\n");
 		exit(0);
 	default:
 		fprintf(stderr, "Unknown argument key %x\n", key);


remove the buggy init with 1 arg

remove the buggy init with 1 arg

--- linbox/linbox/field/local2_32.h
+++ linbox/linbox/field/local2_32.h
@@ -51,7 +51,7 @@

 		typedef UnparametricField<uint32>::Element Element;
 		typedef enum {_min=0,_max=32} Exponent; // enum?
-		Exponent& init(Exponent& a) { return a = 32; }
+		//Exponent& init(Exponent& a) { return a = 32; }

 		Local2_32 (int p=2, int exp=32) :UnparametricField<uint32>(p,exp) {
 			if(p != 2) throw PreconditionFailed(__FUNCTION__,__LINE__,"modulus must be 2");


add nullability annotations to BBAddressBookPersonTableViewCell.h

--- BBFrameworks/BBAddressBookUI/BBAddressBookPersonTableViewCell.h
+++ BBFrameworks/BBAddressBookUI/BBAddressBookPersonTableViewCell.h
@@ -15,10 +15,14 @@

 #import <UIKit/UIKit.h>

+NS_ASSUME_NONNULL_BEGIN
+
 @class BBAddressBookPerson;

 @interface BBAddressBookPersonTableViewCell : UITableViewCell

-@property (strong,nonatomic) BBAddressBookPerson *person;
+@property (strong,nonatomic,nullable) BBAddressBookPerson *person;

 @end
+
+NS_ASSUME_NONNULL_END


Off-by-one when computing right-hand word-break for smartypants.

--- smartypants.c
+++ smartypants.c
@@ -260,6 +260,12 @@
 	return 1;
 }

+/*
+ * See if the character to the right of position "pos" in node "n" marks
+ * the end of a word.
+ * This may require us to traverse the node graph if we're on a node
+ * boundary as well.
+ */
 static int
 smarty_right_wb(const struct lowdown_node *n, size_t pos)
 {
@@ -268,7 +274,7 @@
 	assert(n->type == LOWDOWN_NORMAL_TEXT);
 	b = &n->rndr_normal_text.text;

-	if (pos + 1 < b->size)
+	if (pos + 1 <= b->size)
 		return smarty_iswb(b->data[pos]);

 	return smarty_right_wb_r(n, 1);


removed detection of packets with the same time stamp, because it doesn't work as expected on slow hardware of a raspberry pi

--- hcxpcaptool.c
+++ hcxpcaptool.c
@@ -260,7 +260,6 @@
 FILE *fhnetwork;

 bool tscleanflag;
-bool tssameflag;

 int endianess;
 int pcapreaderrors;
@@ -274,9 +273,6 @@
 uint8_t myaktnonce[32];

 uint8_t filtermac[6];
-
-uint32_t tv_sec_old;
-uint32_t tv_usec_old;

 char pcapnghwinfo[1024];
 char pcapngosinfo[1024];
@@ -540,10 +536,6 @@
 	{
 	printf("warning..........................: zero value time stamps detected - this prevents EAPOL timeout calculation\n");
 	}
-if(tssameflag == true)
-	{
-	printf("warning..........................: packets with same time stamp detected - this prevents EAPOL timeout calculation\n");
-	}
 if(wdsframecount != 0)
 	{
 	printf("WDS packets......................: %llu\n", wdsframecount);
@@ -5282,12 +5274,6 @@
 	tv_sec = tvtmp.tv_sec;
 	tv_usec = tvtmp.tv_usec;
 	}
-else if ((tv_sec == tv_sec_old) && (tv_usec == tv_usec_old))
-	{
-	tssameflag = true;
-	}
-tv_sec_old = tv_sec;
-tv_usec_old = tv_usec;

 if(linktype == DLT_NULL)
 	{
@@ -6114,7 +6100,6 @@
 char *msnetmon2str = "Microsoft NetworkMonitor 2";

 tscleanflag = false;
-tssameflag = false;

 versionmajor = 0;
 versionminor = 0;
@@ -6212,9 +6197,6 @@
 lon = 0;
 alt = 0;

-tv_sec_old = 0xffffffff;
-tv_usec_old = 0xffffffff;
-
 char *unknown = "unknown";
 char tmpoutname[PATH_MAX+1];


update

update

--- include/common/flags.h
+++ include/common/flags.h
@@ -124,7 +124,7 @@
     //! Swap two instances
     void swap(Flags& flags) noexcept { using std::swap; swap(_value, flags._value); }
     template <typename UEnum>
-    friend void swap(Flags<UEnum>& flags1, Flags<UEnum>& flag2) noexcept { flags1.swap(flags2); }
+    friend void swap(Flags<UEnum>& flags1, Flags<UEnum>& flags2) noexcept { flags1.swap(flags2); }

 private:
     type _value;


allow nc only < 8 as nonce errorcorrections for hccap and john (running 128 hash files are to big)

--- hcxpcaptool.c
+++ hcxpcaptool.c
@@ -1702,9 +1702,9 @@
 							memcpy(zeiger->essid, zeigeressid->essid, zeigeressid->essidlen);
 							if(essidchangecount < maxessidchanges)
 								{
-								if(maxrcdiff > 128)
+								if(maxrcdiff > 8)
 									{
-									writehccaprecord(128, zeiger, fhoutlist);
+									writehccaprecord(8, zeiger, fhoutlist);
 									}
 								else
 									{
@@ -1836,9 +1836,9 @@
 							memcpy(zeiger->essid, zeigeressid->essid, zeigeressid->essidlen);
 							if(essidchangecount < maxessidchanges)
 								{
-								if(maxrcdiff > 128)
+								if(maxrcdiff > 8)
 									{
-									writejohnrecord(128, zeiger, fhoutlist, pcapinname);
+									writejohnrecord(8, zeiger, fhoutlist, pcapinname);
 									}
 								else
 									{
@@ -2084,7 +2084,14 @@
 							zeiger->essidlen = zeigeressid->essidlen;
 							memset(zeiger->essid, 0, 32);
 							memcpy(zeiger->essid, zeigeressid->essid, zeigeressid->essidlen);
-							writehccaprecord(maxrcdiff, zeiger, fhoutlist);
+							if(maxrcdiff > 8)
+								{
+								writehccaprecord(8, zeiger, fhoutlist);
+								}
+							else
+								{
+								writehccaprecord(maxrcdiff, zeiger, fhoutlist);
+								}
 							writtencount++;
 							essidchangecount++;
 							memset(&essidold, 0,32);
@@ -2100,7 +2107,14 @@
 					{
 					memset(zeiger->essid, 0, 32);
 					zeiger->essidlen = 0;
-					writehccaprecord(maxrcdiff, zeiger, fhoutlist);
+					if(maxrcdiff > 8)
+						{
+						writehccaprecord(8, zeiger, fhoutlist);
+						}
+					else
+						{
+						writehccaprecord(maxrcdiff, zeiger, fhoutlist);
+						}
 					writtencount++;
 					}
 				}
@@ -2144,7 +2158,14 @@
 							zeiger->essidlen = zeigeressid->essidlen;
 							memset(zeiger->essid, 0, 32);
 							memcpy(zeiger->essid, zeigeressid->essid, zeigeressid->essidlen);
-							writejohnrecord(maxrcdiff, zeiger, fhoutlist, pcapinname);
+							if(maxrcdiff > 8)
+								{
+								writejohnrecord(8, zeiger, fhoutlist, pcapinname);
+								}
+							else
+								{
+								writejohnrecord(maxrcdiff, zeiger, fhoutlist, pcapinname);
+								}
 							writtencount++;
 							essidchangecount++;
 							memset(&essidold, 0,32);
@@ -2160,7 +2181,14 @@
 					{
 					memset(zeiger->essid, 0, 32);
 					zeiger->essidlen = 0;
-					writejohnrecord(maxrcdiff, zeiger, fhoutlist, pcapinname);
+					if(maxrcdiff > 8)
+						{
+						writejohnrecord(8, zeiger, fhoutlist, pcapinname);
+						}
+					else
+						{
+						writejohnrecord(maxrcdiff, zeiger, fhoutlist, pcapinname);
+						}
 					writtencount++;
 					}
 				}


No error if function marked with SK_WARN_UNUSED_RESULT is used in SkAssertResult
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955263002

Review-Url: https://codereview.chromium.org/1955263002

--- include/core/SkTypes.h
+++ include/core/SkTypes.h
@@ -148,8 +148,9 @@
     #define SkDECLAREPARAM(type, var)
     #define SkPARAM(var)

-    // unlike SkASSERT, this guy executes its condition in the non-debug build
-    #define SkAssertResult(cond)        cond
+    // unlike SkASSERT, this guy executes its condition in the non-debug build.
+    // It casts to void to allow use with functions declared with SK_WARN_RESULT_UNUSED.
+    #define SkAssertResult(cond)        (void)(cond)
 #endif

 // Legacy macro names for SK_ABORT


rtpmp4gdepay: factor out pushing of output buffer

--- gst/rtp/gstrtpmp4gdepay.c
+++ gst/rtp/gstrtpmp4gdepay.c
@@ -325,10 +325,30 @@
 }

 static void
+gst_rtp_mp4g_depay_push_outbuf (GstRtpMP4GDepay * rtpmp4gdepay,
+    GstBuffer * outbuf, guint AU_index)
+{
+  gboolean discont = FALSE;
+
+  if (AU_index != rtpmp4gdepay->next_AU_index) {
+    GST_DEBUG_OBJECT (rtpmp4gdepay, "discont, expected AU_index %u",
+        rtpmp4gdepay->next_AU_index);
+    GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+    discont = TRUE;
+  }
+
+  GST_DEBUG_OBJECT (rtpmp4gdepay, "pushing %sAU_index %u",
+      discont ? "" : "expected ", AU_index);
+
+  gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpmp4gdepay), outbuf, 0);
+  gst_rtp_base_depayload_push (GST_RTP_BASE_DEPAYLOAD (rtpmp4gdepay), outbuf);
+  rtpmp4gdepay->next_AU_index = AU_index + 1;
+}
+
+static void
 gst_rtp_mp4g_depay_flush_queue (GstRtpMP4GDepay * rtpmp4gdepay)
 {
   GstBuffer *outbuf;
-  gboolean discont = FALSE;
   guint AU_index;

   while ((outbuf = g_queue_pop_head (rtpmp4gdepay->packets))) {
@@ -336,21 +356,7 @@

     GST_DEBUG_OBJECT (rtpmp4gdepay, "next available AU_index %u", AU_index);

-    if (rtpmp4gdepay->next_AU_index != AU_index) {
-      GST_DEBUG_OBJECT (rtpmp4gdepay, "discont, expected AU_index %u",
-          rtpmp4gdepay->next_AU_index);
-      discont = TRUE;
-    }
-
-    if (discont) {
-      GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
-      discont = FALSE;
-    }
-
-    GST_DEBUG_OBJECT (rtpmp4gdepay, "pushing AU_index %u", AU_index);
-    gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpmp4gdepay), outbuf, 0);
-    gst_rtp_base_depayload_push (GST_RTP_BASE_DEPAYLOAD (rtpmp4gdepay), outbuf);
-    rtpmp4gdepay->next_AU_index = AU_index + 1;
+    gst_rtp_mp4g_depay_push_outbuf (rtpmp4gdepay, outbuf, AU_index);
   }
 }

@@ -369,9 +375,7 @@

     /* we received the expected packet, push it and flush as much as we can from
      * the queue */
-    gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpmp4gdepay), outbuf, 0);
-    gst_rtp_base_depayload_push (GST_RTP_BASE_DEPAYLOAD (rtpmp4gdepay), outbuf);
-    rtpmp4gdepay->next_AU_index++;
+    gst_rtp_mp4g_depay_push_outbuf (rtpmp4gdepay, outbuf, AU_index);

     while ((outbuf = g_queue_peek_head (rtpmp4gdepay->packets))) {
       AU_index = GST_BUFFER_OFFSET (outbuf);
@@ -379,13 +383,8 @@
       GST_DEBUG_OBJECT (rtpmp4gdepay, "next available AU_index %u", AU_index);

       if (rtpmp4gdepay->next_AU_index == AU_index) {
-        GST_DEBUG_OBJECT (rtpmp4gdepay, "pushing expected AU_index %u",
-            AU_index);
         outbuf = g_queue_pop_head (rtpmp4gdepay->packets);
-        gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpmp4gdepay), outbuf, 0);
-        gst_rtp_base_depayload_push (GST_RTP_BASE_DEPAYLOAD (rtpmp4gdepay),
-            outbuf);
-        rtpmp4gdepay->next_AU_index++;
+        gst_rtp_mp4g_depay_push_outbuf (rtpmp4gdepay, outbuf, AU_index);
       } else {
         GST_DEBUG_OBJECT (rtpmp4gdepay, "waiting for next AU_index %u",
             rtpmp4gdepay->next_AU_index);


zoomsh: Refactor command show

zoomsh: Refactor command show

--- zoom/zoomsh.c
+++ zoom/zoomsh.c
@@ -168,12 +168,12 @@

 static void display_records(ZOOM_connection c,
                             ZOOM_resultset r,
-                            int start, int count, const char *type)
-{
-    int i;
-    for (i = 0; i<count; i++)
-    {
-        int pos = i + start;
+                            size_t start, size_t count, const char *type)
+{
+    size_t i;
+    for (i = 0; i < count; i++)
+    {
+        size_t pos = i + start;
         ZOOM_record rec = ZOOM_resultset_record(r, pos);
         const char *db = ZOOM_record_get(rec, "database", 0);

@@ -184,7 +184,8 @@
             const char *diagset;
             int error = ZOOM_record_error(rec, &msg, &addinfo, &diagset);

-            printf("%d %s: %s (%s:%d) %s\n", pos, (db ? db : "unknown"),
+            printf("%lld %s: %s (%s:%d) %s\n", (long long) pos,
+                   (db ? db : "unknown"),
                    msg, diagset, error, addinfo ? addinfo : "none");
         }
         else
@@ -197,8 +198,8 @@
             /* if rec is non-null, we got a record for display */
             if (rec)
             {
-                printf("%d database=%s syntax=%s schema=%s\n",
-                       pos, (db ? db : "unknown"), syntax,
+                printf("%lld database=%s syntax=%s schema=%s\n",
+                       (long long) pos, (db ? db : "unknown"), syntax,
                        schema ? schema : "unknown");
                 if (render)
                 {
@@ -224,25 +225,28 @@
                      const char **args)
 {
     int i;
-    char start_str[10], count_str[10], render_str[60];
+    size_t start = 0, count = 1;
     const char *type = "render";
-
-    if (next_token_copy(args, start_str, sizeof(start_str)) >= 0)
-        ZOOM_options_set(options, "start", start_str);
-
-    if (next_token_copy(args, count_str, sizeof(count_str)) <= 0)
-        strcpy(count_str, "1");
-    ZOOM_options_set(options, "count", count_str);
-
-    if (next_token_copy(args, render_str, sizeof(render_str)) >= 0)
-        type = render_str;
-
-    for (i = 0; i<MAX_CON; i++)
-        ZOOM_resultset_records(r[i], 0, atoi(start_str), atoi(count_str));
+    char render_str[40];
+
+    {
+        char start_str[30], count_str[30];
+        if (next_token_copy(args, start_str, sizeof(start_str)) > 0)
+            start = atoi(start_str);
+
+        if (next_token_copy(args, count_str, sizeof(count_str)) > 0)
+            count = atoi(count_str);
+
+        if (next_token_copy(args, render_str, sizeof(render_str)) > 0)
+            type = render_str;
+    }
+
+    for (i = 0; i < MAX_CON; i++)
+        ZOOM_resultset_records(r[i], 0, start, count);
     while (ZOOM_event(MAX_CON, c))
         ;

-    for (i = 0; i<MAX_CON; i++)
+    for (i = 0; i < MAX_CON; i++)
     {
         int error;
         const char *errmsg, *addinfo, *dset;
@@ -256,13 +260,9 @@
         else if (r[i])
         {
             /* OK, no major errors. Display records... */
-            int start = ZOOM_options_get_int(options, "start", 0);
-            int count = ZOOM_options_get_int(options, "count", 0);
             display_records(c[i], r[i], start, count, type);
         }
     }
-    ZOOM_options_set(options, "count", "0");
-    ZOOM_options_set(options, "start", "0");
 }

 static void cmd_ext(ZOOM_connection *c, ZOOM_resultset *r,


branches/zip: Merge revisions 4746:4976 from branches/5.1:

  ------------------------------------------------------------------------
  r4976 | marko | 2009-05-13 15:44:54 +0300 (Wed, 13 May 2009) | 6 lines

  branches/5.1: Display DB_ROLL_PTR in the COLUMNS section of the
  innodb_table_monitor output.  It was accidentally omitted due to an
  off-by-one loop condition.  (Bug #44320)

  rb://116 approved by Heikki Tuuri
  ------------------------------------------------------------------------

--- dict/dict0dict.c
+++ dict/dict0dict.c
@@ -4299,7 +4299,7 @@
 		(ulong) UT_LIST_GET_LEN(table->indexes),
 		(ulong) table->stat_n_rows);

-	for (i = 0; i + 1 < (ulint) table->n_cols; i++) {
+	for (i = 0; i < (ulint) table->n_cols; i++) {
 		dict_col_print_low(table, dict_table_get_nth_col(table, i));
 		fputs("; ", stderr);
 	}


hdata: Add protection against corrupt ntuples structure

Found using afl-lop on P9 HDAT. Pretty obvious what the problem is once
you look at it, and it's much better having a controlled failure mode
than just going off randomly into memory and segfaulting.

Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.ibm.com>
Reviewed-by: Vasant Hegde <a6d753843573f7bfed5075c1e875b0be8007a0ab@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.ibm.com>

--- hdata/spira.c
+++ hdata/spira.c
@@ -215,8 +215,29 @@
 				   const char *file, int line)
 {
 	struct HDIF_common_hdr *h = ntuple_addr(n);
+	u16 act_cnt, alloc_cnt;
+	u32 act_len, alloc_len;
+
 	if (!spira_check_ptr(h, file, line))
 		return NULL;
+
+	act_cnt = be16_to_cpu(n->act_cnt);
+	alloc_cnt = be16_to_cpu(n->alloc_cnt);
+
+	if (act_cnt > alloc_cnt) {
+		prerror("SPIRA: bad ntuple, act_cnt > alloc_cnt (%u > %u)\n",
+			act_cnt, alloc_cnt);
+		return NULL;
+	}
+
+	act_len = be32_to_cpu(n->act_len);
+	alloc_len = be32_to_cpu(n->alloc_len);
+
+	if (act_len > alloc_len) {
+		prerror("SPIRA: bad ntuple, act_len > alloc_len (%u > %u)\n",
+			act_len, alloc_len);
+		return NULL;
+	}

 	if (!HDIF_check(h, id)) {
 		prerror("SPIRA: bad tuple %p: expected %s at %s line %d\n",


Fixed a build error

Fixed a build error

--- include/cphvb_pprint.h
+++ include/cphvb_pprint.h
@@ -47,7 +47,7 @@
  * @param instruction_count Number of instruction in list.
  * @param instruction_list Array of instructions.
  */
-void cphvb_pprint_bundle( cphvb_intp instruction_count, cphvb_instruction* instruction_list );
+void cphvb_pprint_bundle( cphvb_instruction* instruction_list, cphvb_intp instruction_count );

 #ifdef __cplusplus
 }


[BITSET] FAIL: containing different element

--- bitset/test.c
+++ bitset/test.c
@@ -31,6 +31,7 @@
 	// bitset_contains tests
 	asserter_crash_if(bitset_contains(bitset_empty(), 0), __LINE__);
 	asserter_crash_if(! bitset_contains(bitset_add(bitset_empty(), 0), 0), __LINE__);
+	asserter_crash_if(bitset_contains(bitset_add(bitset_empty(), 0), 1), __LINE__);

 	return 0;
 }


Fix some problems with the GailLinkButton implementation

--- gtk/a11y/gaillinkbutton.c
+++ gtk/a11y/gaillinkbutton.c
@@ -43,6 +43,17 @@
 G_DEFINE_TYPE_WITH_CODE (GailLinkButtonLink, gail_link_button_link, ATK_TYPE_HYPERLINK,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))

+static GailLinkButtonLink *
+gail_link_button_link_new (GailLinkButton *button)
+{
+  GailLinkButtonLink *link;
+
+  link = g_object_new (gail_link_button_link_get_type (), NULL);
+  link->button = button;
+
+  return link;
+}
+
 static gchar *
 gail_link_button_link_get_uri (AtkHyperlink *link,
                                gint          i)
@@ -213,12 +224,12 @@

   if (!button->link)
     {
-      button->link = g_object_new (gail_link_button_link_get_type (), NULL);
+      button->link = gail_link_button_link_new (button);
       g_signal_connect (gtk_accessible_get_widget (GTK_ACCESSIBLE (button)),
                         "activate-link", G_CALLBACK (activate_link), button->link);
     }

-  return button->link;
+  return g_object_ref (button->link);
 }

 static void atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface);


Drop a few unneeded ifs

Drop a few unneeded ifs

It does not hurt to pass NULL to g_list_free().

--- gtk/gtkappchooserwidget.c
+++ gtk/gtkappchooserwidget.c
@@ -798,17 +798,10 @@
   if (default_app != NULL)
     g_object_unref (default_app);

-  if (all_applications != NULL)
-    g_list_free_full (all_applications, g_object_unref);
-
-  if (recommended_apps != NULL)
-    g_list_free_full (recommended_apps, g_object_unref);
-
-  if (fallback_apps != NULL)
-    g_list_free_full (fallback_apps, g_object_unref);
-
-  if (exclude_apps != NULL)
-    g_list_free (exclude_apps);
+  g_list_free_full (all_applications, g_object_unref);
+  g_list_free_full (recommended_apps, g_object_unref);
+  g_list_free_full (fallback_apps, g_object_unref);
+  g_list_free (exclude_apps);
 }

 static void


forgot to include this file in previous commit (needed for lapack)

--- blas/common.h
+++ blas/common.h
@@ -105,6 +105,7 @@
   Conj = IsComplex
 };

+typedef Matrix<Scalar,Dynamic,Dynamic,ColMajor> PlainMatrixType;
 typedef Map<Matrix<Scalar,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> > MatrixType;
 typedef Map<Matrix<Scalar,Dynamic,1>, 0, InnerStride<Dynamic> > StridedVectorType;
 typedef Map<Matrix<Scalar,Dynamic,1> > CompactVectorType;


jetson: refactor names to specify ina3221x driver

--- jetson/energymon-jetson.c
+++ jetson/energymon-jetson.c
@@ -39,12 +39,12 @@

 #define NUM_RAILS_DEFAULT_MAX 6

-#define INA3221_DIR "/sys/bus/i2c/drivers/ina3221x"
-#define INA3221_DIR_TEMPLATE_BUS_ADDR INA3221_DIR"/%s"
-#define INA3221_DIR_TEMPLATE_DEVICE INA3221_DIR"/%s/%s"
-#define INA3221_FILE_TEMPLATE_RAIL_NAME INA3221_DIR"/%s/%s/rail_name_%d"
-#define INA3221_FILE_TEMPLATE_POWER INA3221_DIR"/%s/%s/in_power%d_input"
-#define INA3221_FILE_TEMPLATE_POLLING_DELAY INA3221_DIR"/%s/%s/polling_delay_%d"
+#define INA3221X_DIR "/sys/bus/i2c/drivers/ina3221x"
+#define INA3221X_DIR_TEMPLATE_BUS_ADDR INA3221X_DIR"/%s"
+#define INA3221X_DIR_TEMPLATE_DEVICE INA3221X_DIR"/%s/%s"
+#define INA3221X_FILE_TEMPLATE_RAIL_NAME INA3221X_DIR"/%s/%s/rail_name_%d"
+#define INA3221X_FILE_TEMPLATE_POWER INA3221X_DIR"/%s/%s/in_power%d_input"
+#define INA3221X_FILE_TEMPLATE_POLLING_DELAY INA3221X_DIR"/%s/%s/polling_delay_%d"

 // Environment variable to request a minimum polling interval.
 // Keeping this as an undocumented feature for now.
@@ -112,23 +112,23 @@
   return ret;
 }

-static int try_read_rail_name(const char* bus_addr, const char* device, int channel, char* name, size_t len) {
+static int ina3221x_try_read_rail_name(const char* bus_addr, const char* device, int channel, char* name, size_t len) {
   char file[PATH_MAX];
-  snprintf(file, sizeof(file), INA3221_FILE_TEMPLATE_RAIL_NAME, bus_addr, device, channel);
+  snprintf(file, sizeof(file), INA3221X_FILE_TEMPLATE_RAIL_NAME, bus_addr, device, channel);
   return read_string(file, name, len);
 }

-static long try_read_polling_delay_us(const char* bus_addr, const char* device, int channel) {
+static long ina3221x_try_read_polling_delay_us(const char* bus_addr, const char* device, int channel) {
   char file[PATH_MAX];
-  snprintf(file, sizeof(file), INA3221_FILE_TEMPLATE_POLLING_DELAY, bus_addr, device, channel);
+  snprintf(file, sizeof(file), INA3221X_FILE_TEMPLATE_POLLING_DELAY, bus_addr, device, channel);
   // TODO: output includes precision (e.g., "0 ms") - set endptr in the read and parse this
   return read_long(file) * 1000;
 }

-static int open_power_file(const char* bus_addr, const char* device, int channel) {
+static int ina3221x_open_power_file(const char* bus_addr, const char* device, int channel) {
   char file[PATH_MAX];
   int fd;
-  snprintf(file, sizeof(file), INA3221_FILE_TEMPLATE_POWER, bus_addr, device, channel);
+  snprintf(file, sizeof(file), INA3221X_FILE_TEMPLATE_POWER, bus_addr, device, channel);
   if ((fd = open(file, O_RDONLY)) < 0) {
     perror(file);
   }
@@ -151,8 +151,8 @@
          && entry->d_name[1] == '-';
 }

-static int walk_device_dir(const char* const* names, int* fds, size_t len, unsigned long* polling_delay_us_max,
-                           const char* bus_addr, const char* device) {
+static int ina3221x_walk_device_dir(const char* const* names, int* fds, size_t len, unsigned long* polling_delay_us_max,
+                                    const char* bus_addr, const char* device) {
   // for each rail_name_X, open power file if its name is in list
   // there are 3 channels per device, but it's possible they aren't all connected
   char name[64];
@@ -161,7 +161,7 @@
   long polling_delay_us;
   for (channel = 0; channel < INA3221_CHANNELS_MAX; channel++) {
     errno = 0;
-    if (try_read_rail_name(bus_addr, device, channel, name, sizeof(name)) < 0) {
+    if (ina3221x_try_read_rail_name(bus_addr, device, channel, name, sizeof(name)) < 0) {
       if (errno == ENOENT) {
         // assume this means the channel isn't connected, which is not an error
         continue;
@@ -175,10 +175,10 @@
             errno = EEXIST;
             return -1;
           }
-          if ((fds[i] = open_power_file(bus_addr, device, channel)) < 0) {
+          if ((fds[i] = ina3221x_open_power_file(bus_addr, device, channel)) < 0) {
             return -1;
           }
-          polling_delay_us = try_read_polling_delay_us(bus_addr, device, channel);
+          polling_delay_us = ina3221x_try_read_polling_delay_us(bus_addr, device, channel);
           if (polling_delay_us > 0 && (unsigned long) polling_delay_us > *polling_delay_us_max) {
             *polling_delay_us_max = (unsigned long) polling_delay_us;
           }
@@ -190,21 +190,21 @@
   return 0;
 }

-static int walk_bus_addr_dir(const char* const* names, int* fds, size_t len, unsigned long* polling_delay_us_max,
-                             const char* bus_addr) {
+static int ina3221x_walk_bus_addr_dir(const char* const* names, int* fds, size_t len,
+                                      unsigned long* polling_delay_us_max, const char* bus_addr) {
   // for each name format iio:deviceX
   DIR* dir;
   const struct dirent* entry;
   char path[PATH_MAX];
   int ret = 0;
-  snprintf(path, sizeof(path), INA3221_DIR_TEMPLATE_BUS_ADDR, bus_addr);
+  snprintf(path, sizeof(path), INA3221X_DIR_TEMPLATE_BUS_ADDR, bus_addr);
   if ((dir = opendir(path)) == NULL) {
     perror(path);
     return -1;
   }
   while ((entry = readdir(dir)) != NULL) {
     if (is_iio_device_dir(entry)) {
-      if ((ret = walk_device_dir(names, fds, len, polling_delay_us_max, bus_addr, entry->d_name)) < 0) {
+      if ((ret = ina3221x_walk_device_dir(names, fds, len, polling_delay_us_max, bus_addr, entry->d_name)) < 0) {
         break;
       }
     }
@@ -215,24 +215,25 @@
   return ret;
 }

-static int walk_i2c_drivers_dir(const char* const* names, int* fds, size_t len, unsigned long* polling_delay_us_max) {
+static int ina3221x_walk_i2c_drivers_dir(const char* const* names, int* fds, size_t len,
+                                         unsigned long* polling_delay_us_max) {
   // for each name format X-ABCDE
   DIR* dir;
   const struct dirent* entry;
   int ret = 0;
-  if ((dir = opendir(INA3221_DIR)) == NULL) {
-    perror(INA3221_DIR);
+  if ((dir = opendir(INA3221X_DIR)) == NULL) {
+    perror(INA3221X_DIR);
     return -1;
   }
   while ((entry = readdir(dir)) != NULL) {
     if (is_i2c_bus_addr_dir(entry)) {
-      if ((ret = walk_bus_addr_dir(names, fds, len, polling_delay_us_max, entry->d_name)) < 0) {
+      if ((ret = ina3221x_walk_bus_addr_dir(names, fds, len, polling_delay_us_max, entry->d_name)) < 0) {
         break;
       }
     }
   }
   if (closedir(dir)) {
-    perror(INA3221_DIR);
+    perror(INA3221X_DIR);
   }
   return ret;
 }
@@ -269,7 +270,7 @@
   DEFAULT_RAIL_NAMES_POM_5V_IN,
   DEFAULT_RAIL_NAMES_AGX_XAVIER,
 };
-static int walk_i2c_drivers_dir_for_default(int* fds, size_t* n_fds, unsigned long* polling_delay_us_max) {
+static int ina3221x_walk_i2c_drivers_dir_for_default(int* fds, size_t* n_fds, unsigned long* polling_delay_us_max) {
   size_t i;
   size_t j;
 #ifndef NDEBUG
@@ -282,7 +283,7 @@
     }
     assert(*n_fds > 0);
     assert(*n_fds <= max_fds);
-    if (walk_i2c_drivers_dir(DEFAULT_RAIL_NAMES[i], fds, *n_fds, polling_delay_us_max)) {
+    if (ina3221x_walk_i2c_drivers_dir(DEFAULT_RAIL_NAMES[i], fds, *n_fds, polling_delay_us_max)) {
       // cleanup is done in the calling function
       return -1;
     }
@@ -472,7 +473,7 @@
   state->count = n_rails;

   if (rail_names) {
-    if (walk_i2c_drivers_dir((const char* const*) rail_names, state->fds, n_rails, &polling_delay_us)) {
+    if (ina3221x_walk_i2c_drivers_dir((const char* const*) rail_names, state->fds, n_rails, &polling_delay_us)) {
       goto fail_rails;
     }
     for (i = 0; i < n_rails; i++) {
@@ -484,7 +485,7 @@
     }
     free_rail_names(rail_names, n_rails);
   } else {
-    if (walk_i2c_drivers_dir_for_default(state->fds, &n_rails, &polling_delay_us)) {
+    if (ina3221x_walk_i2c_drivers_dir_for_default(state->fds, &n_rails, &polling_delay_us)) {
       if (errno == ENODEV) {
         fprintf(stderr, "energymon_init_jetson: did not find default rail(s) - is this a supported model?\n"
                 "Try setting "ENERGYMON_JETSON_RAIL_NAMES"\n");


w2v sliced native CPU code compiling

w2v sliced native CPU code compiling

--- jni/src/BIDMach_CPUMACH.c
+++ jni/src/BIDMach_CPUMACH.c
@@ -73,6 +73,112 @@
   (*env)->ReleasePrimitiveArrayCritical(env, jW, W, 0);
 }

+void mapIndx(int *mm, int *ii, int *ismine, int *ishead, int indx, int islice, int nslices, int nhead, int maxcols, int nrows, int offset)
+{
+  int newi = indx;
+  if (indx >= nhead) newi = ((indx - nhead) / nslices + nhead);                     // new column index
+  *mm = newi / maxcols + offset;                                 // which matrix are we in?
+  *ismine = (indx >= nhead) && (indx % nslices == islice);
+  *ishead = (indx < nhead);
+  *ii = nrows * (newi - (*mm) * maxcols);
+}
+
+JNIEXPORT void JNICALL Java_edu_berkeley_bid_CPUMACH_word2vecPosSlice
+(JNIEnv *env, jobject obj, jint nrows, jint ncols, jint skip, jintArray jW, jintArray jLB, jintArray jUB,
+ jobjectArray jMM, jfloat lrate, jfloat vexp, jint nthreads,
+ jint islice, jint nslices, jint maxCols, jint nHead, jint dualMode, jint doHead)
+{
+  int ix, ithread;
+  int offset = 0;
+  int * W = (jint *)((*env)->GetPrimitiveArrayCritical(env, jW, JNI_FALSE));
+  int * LB = (jint *)((*env)->GetPrimitiveArrayCritical(env, jLB, JNI_FALSE));
+  int * UB = (jint *)((*env)->GetPrimitiveArrayCritical(env, jUB, JNI_FALSE));
+  int nelems = (*env)->GetArrayLength(env, jMM);
+  jfloatArray *X = malloc(nelems * sizeof(jfloatArray));
+  float **Y = malloc(nelems * sizeof(float *));
+  float *A, *B;
+  if (dualMode) offset = 1;
+  for (ix = 0; ix < nelems; ix++) {
+     X[ix] = (jfloatArray)((*env)->GetObjectArrayElement(env, jMM, ix));
+     Y[ix] = (float *)((*env)->GetPrimitiveArrayCritical(env, X[ix], JNI_FALSE));
+  }
+
+#pragma omp parallel for
+  for (ithread = 0; ithread < nthreads; ithread++) {
+    int istart = (1L * ithread * ncols)/nthreads;
+    int iend = (1L * (ithread+1) * ncols)/nthreads;
+    int i, j, k, c, ia, ib, iac, ibc, coff;
+    int aismine, bismine, aishead, bishead, ma, mb;
+    float cv, ascale, bscale;
+    int touched;
+    float * daa = (float *)malloc(nrows*sizeof(float));
+
+    for (i = istart; i < iend; i++) {
+      iac = W[i];
+      if (iac >= 0) {
+        mapIndx(&ma, &ia, &aismine, &aishead, iac, islice, nslices, nHead, maxCols, nrows, offset);
+        A = Y[2*ma+1];
+        ascale = pow(1+iac, vexp);
+        for (c = 0; c < nrows; c++) {
+          daa[c] = 0;
+        }
+        touched = 0;
+        for (j = LB[i]; j <= UB[i]; j++) {
+          if (j != 0 && i + j >= 0 && i + j < ncols) {
+            ibc = W[i + j];
+            if (ibc >= 0) {
+              mapIndx(&mb, &ib, &bismine, &bishead, ibc, islice, nslices, nHead, maxCols, nrows, offset);
+              B = Y[2*mb];
+              bscale = pow(1+ibc, vexp);
+              if ((aismine && bishead) || (bismine && aishead) || (aismine && bismine)) {
+                touched = 1;
+                cv = 0;
+                for (c = 0; c < nrows; c++) {
+                  cv += A[c + ia] * B[c + ib];
+                }
+
+                if (cv > 16.0f) {
+                  cv = 1.0f;
+                } else if (cv < -16.0f) {
+                  cv = 0.0f;
+                } else {
+                  cv = exp(cv);
+                  cv = cv / (1.0f + cv);
+                }
+
+                cv = lrate * (1.0f - cv);
+                for (c = 0; c < nrows; c++) {
+                  daa[c] += ascale * cv * B[c + ib];
+                }
+                if (bismine || (bishead && doHead)) {
+                  for (c = 0; c < nrows; c++) {
+                    B[c + ib] += bscale * cv * A[c + ia];
+                  }
+                }
+              }
+            }
+          }
+        }
+        if (touched && (aismine || (aishead && doHead))) {
+          for (c = 0; c < nrows; c++) {
+            A[c + ia] += daa[c];
+          }
+        }
+      }
+    }
+    free(daa);
+  }
+
+  for (ix = nelems-1; ix >= 0; ix--) {
+    (*env)->ReleasePrimitiveArrayCritical(env, X[ix], Y[ix], 0);
+  }
+  (*env)->ReleasePrimitiveArrayCritical(env, jUB, UB, 0);
+  (*env)->ReleasePrimitiveArrayCritical(env, jLB, LB, 0);
+  (*env)->ReleasePrimitiveArrayCritical(env, jW, W, 0);
+  free(Y);
+  free(X);
+}
+
 JNIEXPORT void JNICALL Java_edu_berkeley_bid_CPUMACH_word2vecNeg
 (JNIEnv *env, jobject obj, jint nrows, jint ncols, jint nwa, jint nwb, jintArray jWA, jintArray jWB,
  jfloatArray jA, jfloatArray jB, jfloat lrate, jfloat vexp, jint nthreads)
@@ -151,6 +257,108 @@
   (*env)->ReleasePrimitiveArrayCritical(env, jA, A, 0);
   (*env)->ReleasePrimitiveArrayCritical(env, jWB, WB, 0);
   (*env)->ReleasePrimitiveArrayCritical(env, jWA, WA, 0);
+}
+
+
+JNIEXPORT void JNICALL Java_edu_berkeley_bid_CPUMACH_word2vecNegSlice
+(JNIEnv *env, jobject obj, jint nrows, jint ncols, jint nwa, jint nwb, jintArray jWA, jintArray jWB,
+ jfloatArray jMM, jfloat lrate, jfloat vexp, jint nthreads,
+ jint islice, jint nslices, jint maxCols, jint nHead, jint dualMode, jint doHead)
+{
+  int ix, ithread, offset = 0;
+  int * WA = (jint *)((*env)->GetPrimitiveArrayCritical(env, jWA, JNI_FALSE));
+  int * WB = (jint *)((*env)->GetPrimitiveArrayCritical(env, jWB, JNI_FALSE));
+  float *A, *B;
+  int nelems = (*env)->GetArrayLength(env, jMM);
+  jfloatArray *X = malloc(nelems * sizeof(jfloatArray));
+  float **Y = malloc(nelems * sizeof(float *));
+  if (dualMode) offset = 1;
+  for (ix = 0; ix < nelems; ix++) {
+     X[ix] = (jfloatArray)((*env)->GetObjectArrayElement(env, jMM, ix));
+     Y[ix] = (float *)((*env)->GetPrimitiveArrayCritical(env, X[ix], JNI_FALSE));
+  }
+
+#pragma omp parallel for
+  for (ithread = 0; ithread < nthreads; ithread++) {
+    int i, j, k, c, ia, ib, iac, ibc, ja;
+    float cv, ascale, bscale;
+    int aismine, bismine, aishead, bishead, ma, mb;
+    int istart = (1L * ithread * ncols)/nthreads;
+    int iend = (1L * (ithread+1) * ncols)/nthreads;
+    float * daa = (float *)malloc(nwa*nrows*sizeof(float));
+    float * dbb = (float *)malloc(nrows*sizeof(float));
+
+    for (i = istart; i < iend; i++) {
+      for (j = 0; j < nwa; j++) {
+        ja = j * nrows;
+        for (c = 0; c < nrows; c++) {
+          daa[c + ja] = 0;
+        }
+      }
+      for (k = 0; k < nwb; k++) {
+        ibc = WB[k+i*nwb];
+        mapIndx(&mb, &ib, &bismine, &bishead, ibc, islice, nslices, nHead, maxCols, nrows, offset);
+        B = Y[2*mb];
+        bscale = pow(1+ibc, vexp);
+        for (c = 0; c < nrows; c++) {
+          dbb[c] = 0;
+        }
+        for (j = 0; j < nwa; j++) {
+          iac = WA[j+i*nwa];
+          mapIndx(&ma, &ia, &aismine, &aishead, iac, islice, nslices, nHead, maxCols, nrows, offset);
+          A = Y[2*ma+1];
+          ascale = pow(1+iac, vexp);
+          if ((aismine && bishead) || (bismine && aishead) || (aismine && bismine)) {
+            cv = 0;
+            for (c = 0; c < nrows; c++) {
+              cv += A[c + ia] * B[c + ib];
+            }
+
+            if (cv > 16.0f) {
+              cv = 1.0f;
+            } else if (cv < -16.0f) {
+              cv = 0.0f;
+            } else {
+              cv = exp(cv);
+              cv = cv / (1.0f + cv);
+            }
+
+            cv = - lrate * cv;
+            ja = j * nrows;
+            for (c = 0; c < nrows; c++) {
+              dbb[c] += bscale * cv * A[c + ia];
+              daa[c + ja] += ascale * cv * B[c + ib];
+            }
+          }
+        }
+        if (bismine || (bishead && doHead)) {
+          for (c = 0; c < nrows; c++) {
+            B[c + ib] += dbb[c];
+          }
+        }
+      }
+      for (j = 0; j < nwa; j++) {
+        ja = j * nrows;
+        iac = WA[j+i*nwa];
+        mapIndx(&ma, &ia, &aismine, &aishead, iac, islice, nslices, nHead, maxCols, nrows, offset);
+        A = Y[2*ma+1];
+        if (aismine || (aishead && doHead)) {
+          for (c = 0; c < nrows; c++) {
+            A[c + ia] += daa[c + ja];
+          }
+        }
+      }
+    }
+    free(dbb);
+    free(daa);
+  }
+  for (ix = nelems-1; ix >= 0; ix--) {
+    (*env)->ReleasePrimitiveArrayCritical(env, X[ix], Y[ix], 0);
+  }
+  (*env)->ReleasePrimitiveArrayCritical(env, jWB, WB, 0);
+  (*env)->ReleasePrimitiveArrayCritical(env, jWA, WA, 0);
+  free(Y);
+  free(X);
 }

 JNIEXPORT jdouble JNICALL Java_edu_berkeley_bid_CPUMACH_word2vecEvalPos


add option to publish Bionet library info to syshealth HAB

--- hab/syshealth/syshealth.c
+++ hab/syshealth/syshealth.c
@@ -66,6 +66,7 @@
 	    "usage: syshealth-hab [OPTIONS]\n"
 	    "\n"
 	    "-d,--delay <sec>         Wait N seconds between updates.  Default is 30\n"
+	    "-i,--info                Publish Bionet library information\n"
 	    "-h,--help                Show this help and exit\n"
 	    "-s,--security-dir <dir>  Directory containing security certificates\n"
 	    "-v,--version             Show the version number\n");
@@ -82,6 +83,7 @@

     int bionet_fd;
     char * security_dir = NULL;
+    int publish_info = 0;

     bionet_log_context_t log_context = {
         destination: BIONET_LOG_TO_SYSLOG,
@@ -103,10 +105,11 @@
 	    {"verison", 0, 0, 'v'},
 	    {"delay", 1, 0, 'd'},
 	    {"security-dir", 1, 0, 's'},
+	    {"info", 0, 0, 'i'},
 	    {0, 0, 0, 0} //this must be last in the list
 	};

-	c = getopt_long(argc, argv, "?vhd:s:", long_options, &i);
+	c = getopt_long(argc, argv, "?vhid:s:", long_options, &i);
 	if (c == -1) {
 	    break;
 	}
@@ -126,6 +129,10 @@
 	    }
 	    break;

+	case 'i':
+	    publish_info = 1;
+	    break;
+
 	case 's':
 	    security_dir = optarg;
 	    break;
@@ -193,8 +200,11 @@
     //
     // report the new Node
     //
-
-    if (hab_publish_info(hab, BIONET_INFO_VERSION_FLAG)) g_log("", G_LOG_LEVEL_ERROR, "hab error adding a node!");
+    if (publish_info) {
+	if (hab_publish_info(hab, BIONET_INFO_VERSION_FLAG)) {
+	    g_log("", G_LOG_LEVEL_ERROR, "hab error adding a node!");
+	}
+    }
     if (bionet_hab_add_node(hab, node)) g_log("", G_LOG_LEVEL_ERROR, "hab error adding a node!");
     if (hab_report_new_node(node)) g_log("", G_LOG_LEVEL_ERROR, "hab error reporting a new node!");
     if (hab_report_datapoints(node)) g_log("", G_LOG_LEVEL_ERROR, "hab error reporting datapoints!");


Document that hwloc_get_type_or_above/below_dep...

Document that hwloc_get_type_or_above/below_depth() can return DEPTH_MULTIPLE

Thanks to Antoine Lucas for reporting the issue.

This commit was SVN r3965.

--- include/hwloc/helper.h
+++ include/hwloc/helper.h
@@ -40,6 +40,9 @@
  * If no object of this type is present on the underlying architecture, the
  * function returns the depth of the first "present" object typically found
  * inside \p type.
+ *
+ * If some objects of the given type exist in different levels, for instance
+ * L1 and L2 caches, the function returns HWLOC_TYPE_DEPTH_MULTIPLE.
  */
 static __hwloc_inline int __hwloc_attribute_pure
 hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
@@ -63,6 +66,9 @@
  * If no object of this type is present on the underlying architecture, the
  * function returns the depth of the first "present" object typically
  * containing \p type.
+ *
+ * If some objects of the given type exist in different levels, for instance
+ * L1 and L2 caches, the function returns HWLOC_TYPE_DEPTH_MULTIPLE.
  */
 static __hwloc_inline int __hwloc_attribute_pure
 hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type)


srand initialization

srand initialization

--- blkin-front.c
+++ blkin-front.c
@@ -3,6 +3,8 @@
 #include <pthread.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>     /* srand, rand */
+#include <time.h>       /* time */

 /* Function pointers to be resolved during initialization */
 int (*blkin_init_new_trace)(struct blkin_trace *new_trace, char *name,
@@ -124,6 +126,11 @@

 int blkin_init(void)
 {
+    /*
+     * Initialize srand with sth appropriete
+     * time is not good for archipelago: several deamons -> same timstamp
+     */
+    srand(time(NULL));
 	int ret;
 	pthread_mutex_lock(&blkin_init_mutex);
 	if (!initialized) {


rename.h: update

rename.h: update

git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@5001 4b44e086-7f34-40ce-a3bd-00e031736276

--- include/hwloc/rename.h
+++ include/hwloc/rename.h
@@ -452,7 +452,7 @@

 #define hwloc_backend_params_u HWLOC_NAME(backend_params_u)
 #define hwloc_backend_params_linuxfs_s HWLOC_NAME(backend_params_linuxfs_s)
-#define hwloc_backend_params_xml_s HWLOC_NAME(backend_params_xml_s)
+#define hwloc_xml_backend_data_s HWLOC_NAME(hwloc_xml_backend_data_s)
 #define hwloc_backend_params_synthetic_s HWLOC_NAME(backend_params_synthetic_s)

 #define hwloc_xml_imported_distances_s HWLOC_NAME(xml_imported_distances_s)


Don't match pattern against 1-d input in dilated conv pass.

PiperOrigin-RevId: 292220461
Change-Id: I8297e51fac26c61fa8f570bd6719097e4f983cb2

--- tensorflow/compiler/mlir/lite/transforms/dilated_conv.h
+++ tensorflow/compiler/mlir/lite/transforms/dilated_conv.h
@@ -217,6 +217,9 @@
     if (stb_bs_attr.getValue({i}) != bts_bs_attr.getValue({i})) return {};
   }

+  // TODO(haoliang): support 1-D dilated conv.
+  if (stb_bs_attr.getNumElements() < 2) return {};
+
   int dilation_h_factor =
       stb_bs_attr.getValue({0}).cast<IntegerAttr>().getInt();
   int dilation_w_factor =


added HeightTest

added HeightTest

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@10613 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- include/imesh/bcterr.h
+++ include/imesh/bcterr.h
@@ -35,7 +35,7 @@

-SCF_VERSION (iBCTerrState, 0, 0, 1);
+SCF_VERSION (iBCTerrState, 0, 0, 2);

 /**
  * This interface describes the API for the Bezier Curve terrain object.
@@ -51,6 +51,7 @@
   	iMaterialWrapper* mat) = 0;
   /// Used to create control points, needs size to be set.
   virtual void SetHeightMap (iImage* im) = 0;
+  virtual int HeightTest (csVector3 *point) = 0;
 };

 SCF_VERSION (iBCTerrFactoryState, 0, 0, 2);


libata: Fix ata_busy_wait() kernel docs

libata: Fix ata_busy_wait() kernel docs

> Looks like you should use ata_busy_wait() here, rather than reproducing
> the same code again.

It waits in 10uS chunks while 1uS chunks were used in the workaround.
Could indeed do that once I know the fix is right. While I'm at it the
ata_busy_wait kerneldoc is borked so here's a fix

Signed-off-by: Alan Cox <91e38e63b890fbb214c8914809fde03c73e7f24d@redhat.com>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

--- include/linux/libata.h
+++ include/linux/libata.h
@@ -1054,6 +1054,8 @@
 /**
  *	ata_busy_wait - Wait for a port status register
  *	@ap: Port to wait for.
+ *	@bits: bits that must be clear
+ *	@max: number of 10uS waits to perform
  *
  *	Waits up to max*10 microseconds for the selected bits in the port's
  *	status register to be cleared.


mmzone.h: remove dead prototype

mmzone.h: remove dead prototype

get_zone_counts() was dropped from kernel tree, see:
http://www.mail-archive.com/mm-commits@vger.kernel.org/msg07313.html but
its prototype remains.

Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- include/linux/mmzone.h
+++ include/linux/mmzone.h
@@ -651,8 +651,6 @@
 #include <linux/memory_hotplug.h>

 extern struct mutex zonelists_mutex;
-void get_zone_counts(unsigned long *active, unsigned long *inactive,
-			unsigned long *free);
 void build_all_zonelists(void *data);
 void wakeup_kswapd(struct zone *zone, int order);
 int zone_watermark_ok(struct zone *z, int order, unsigned long mark,


module: add stub for is_module_percpu_address

Fix build for CONFIG_MODULES not enabled by providing a stub
for is_module_percpu_address().

kernel/lockdep.c:605: error: implicit declaration of function 'is_module_percpu_address'

Signed-off-by: Randy Dunlap <e1d10faa7e2a0c027bf1ff1d20e7fd10154be7ea@oracle.com>
Signed-off-by: Tejun Heo <546b05909706652891a87f7bfe385ae147f61f91@kernel.org>

--- include/linux/module.h
+++ include/linux/module.h
@@ -567,6 +567,11 @@
 	return false;
 }

+static inline bool is_module_percpu_address(unsigned long addr)
+{
+	return false;
+}
+
 static inline bool is_module_text_address(unsigned long addr)
 {
 	return false;


net: Add function to set the rxhash

net: Add function to set the rxhash

The function skb_set_rxash was added for drivers to call to set
the rxhash in an skb. The type of hash is also specified as
a parameter (L2, L3, L4, or unknown type).

Signed-off-by: Tom Herbert <0786393240831fc3b5d6ed63658cfb1f3b1e6c40@google.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- include/linux/skbuff.h
+++ include/linux/skbuff.h
@@ -703,6 +703,46 @@
 			   unsigned int to, struct ts_config *config,
 			   struct ts_state *state);

+/*
+ * Packet hash types specify the type of hash in skb_set_hash.
+ *
+ * Hash types refer to the protocol layer addresses which are used to
+ * construct a packet's hash. The hashes are used to differentiate or identify
+ * flows of the protocol layer for the hash type. Hash types are either
+ * layer-2 (L2), layer-3 (L3), or layer-4 (L4).
+ *
+ * Properties of hashes:
+ *
+ * 1) Two packets in different flows have different hash values
+ * 2) Two packets in the same flow should have the same hash value
+ *
+ * A hash at a higher layer is considered to be more specific. A driver should
+ * set the most specific hash possible.
+ *
+ * A driver cannot indicate a more specific hash than the layer at which a hash
+ * was computed. For instance an L3 hash cannot be set as an L4 hash.
+ *
+ * A driver may indicate a hash level which is less specific than the
+ * actual layer the hash was computed on. For instance, a hash computed
+ * at L4 may be considered an L3 hash. This should only be done if the
+ * driver can't unambiguously determine that the HW computed the hash at
+ * the higher layer. Note that the "should" in the second property above
+ * permits this.
+ */
+enum pkt_hash_types {
+	PKT_HASH_TYPE_NONE,	/* Undefined type */
+	PKT_HASH_TYPE_L2,	/* Input: src_MAC, dest_MAC */
+	PKT_HASH_TYPE_L3,	/* Input: src_IP, dst_IP */
+	PKT_HASH_TYPE_L4,	/* Input: src_IP, dst_IP, src_port, dst_port */
+};
+
+static inline void
+skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
+{
+	skb->l4_rxhash = (type == PKT_HASH_TYPE_L4);
+	skb->rxhash = hash;
+}
+
 void __skb_get_hash(struct sk_buff *skb);
 static inline __u32 skb_get_hash(struct sk_buff *skb)
 {


virtio: configuration change callback

virtio: configuration change callback

Various drivers want to know when their configuration information
changes: the balloon driver is the immediate user, but the network
driver may one day have a "carrier" status as well.

This introduces that callback (lguest doesn't use it yet).

Signed-off-by: Rusty Russell <df9728c9e5104131c08c7adb03af425394842596@rustcorp.com.au>

--- include/linux/virtio.h
+++ include/linux/virtio.h
@@ -98,12 +98,15 @@
  * @probe: the function to call when a device is found.  Returns a token for
  *    remove, or PTR_ERR().
  * @remove: the function when a device is removed.
+ * @config_changed: optional function to call when the device configuration
+ *    changes; may be called in interrupt context.
  */
 struct virtio_driver {
 	struct device_driver driver;
 	const struct virtio_device_id *id_table;
 	int (*probe)(struct virtio_device *dev);
 	void (*remove)(struct virtio_device *dev);
+	void (*config_changed)(struct virtio_device *dev);
 };

 int register_virtio_driver(struct virtio_driver *drv);


cfg80211: dont use union for wext

cfg80211: dont use union for wext

Otherwise it becomes very hard to reset the structs
correctly since wext can be configured while the
interface is down.

Signed-off-by: Johannes Berg <8398eb9892c5ab2ff439ca0b5e4b0706dd9ebef9@sipsolutions.net>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- include/net/cfg80211.h
+++ include/net/cfg80211.h
@@ -1270,10 +1270,8 @@
 #ifdef CONFIG_WIRELESS_EXT
 	/* wext data */
 	struct {
-		union {
-			struct cfg80211_ibss_params ibss;
-			struct cfg80211_connect_params connect;
-		};
+		struct cfg80211_ibss_params ibss;
+		struct cfg80211_connect_params connect;
 		u8 *ie;
 		size_t ie_len;
 		u8 bssid[ETH_ALEN];


ethernet: fix an unaligned access fault by removing __packed.

__packed allows the struct to be linked at a non-word size boundrary
which causes an unaligned access fault on the Cortex-M0+.

Signed-off-by: Michael Hope <c71d7810e3c04e4d6ad9df326b82536b86a1bfbc@google.com>

--- include/net/ethernet.h
+++ include/net/ethernet.h
@@ -56,7 +56,7 @@

 	/** Get the device capabilities */
 	enum eth_hw_caps (*get_capabilities)(struct device *dev);
-} __packed;
+};

 struct net_eth_addr {
 	u8_t addr[6];


[NET]: Remove unnecessary inclusion of dst.h

The file net/netevent.h only refers to struct dst_entry * so it
doesn't need to include dst.h.  I've replaced it with a forward
declaration.

Signed-off-by: Herbert Xu <ef65de1c7be0aa837fe7b25ba9a7739905af6a55@gondor.apana.org.au>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- include/net/netevent.h
+++ include/net/netevent.h
@@ -12,7 +12,7 @@
  */
 #ifdef __KERNEL__

-#include <net/dst.h>
+struct dst_entry;

 struct netevent_redirect {
 	struct dst_entry *old;


mma: use 8 bits resolution for now

mma: use 8 bits resolution for now

--- include/nrf_mma8453q.h
+++ include/nrf_mma8453q.h
@@ -43,9 +43,9 @@
 } drv_accelConfig_t;

 typedef struct {
-    uint16_t x;
-    uint16_t y;
-    uint16_t z;
+    uint8_t x;
+    uint8_t y;
+    uint8_t z;
     bool failed : 1;
 } drv_accelData_t;


Working property

Working property

--- include/rrc/Property.h
+++ include/rrc/Property.h
@@ -6,10 +6,8 @@

 #include <string>
 #include <stdlib.h>
-#include <iostream>
 #include <sstream>
-#include <type_traits>
-#include "rrc/CopyOnWrite.h"
+#include "CopyOnWrite.h"
 #include "mapbox/variant.hpp"

 namespace rrc {
@@ -17,137 +15,134 @@
     public:
         typedef mapbox::util::variant<std::string, float, bool, int> SettingsType;

+        Property(const char* str) {
+            mField->set<std::string>(str);
+        }
+
+        Property(std::string str) {
+            mField->set<std::string>(str);
+        }
+
         template <class D>
         Property(D&& data) {
-            mField = std::forward<D>(data);
+            mField->set<D>(std::forward<D>(data));
+        }
+
+        Property() {
+
         }

         template <typename T>
-        T& get() const {
-            switch(mField->which()) {
-                case 0:
-                    return getCast<T>(mField->get<std::string>());
-                case 1:
-                    return getCast<T>(mField->get<float>());
-                case 2:
-                    return getCast<T>(mField->get<bool>());
-                case 3:
-                    return getCast<T>(mField->get<int>());
-
-            }
+        T get() const {
         }

-        int getInt() const {
-            switch(mField->which()) {
-                case 0:
-                    return getCast<int>(mField->get<std::string>());
-                case 1:
-                    return getCast<int>(mField->get<float>());
-                case 2:
-                    return getCast<int>(mField->get<bool>());
-                case 3:
-                    return getCast<int>(mField->get<int>());
+        int getInt();

-            }
+        float getFloat();
+
+        bool getBool();
+
+        std::string getString();
+
+        void set(const char* str) {
+            mField->set<std::string>(str);
         }

-        float getFloat() const {
-            switch(mField->which()) {
-                case 0:
-                    return getCast<float>(mField->get<std::string>());
-                case 1:
-                    return getCast<float>(mField->get<float>());
-                case 2:
-                    return getCast<float>(mField->get<bool>());
-                case 3:
-                    return getCast<float>(mField->get<int>());
-
-            }
+        void set(std::string str) {
+            mField->set<std::string>(str);
         }

-        bool getBool() const {
-            switch(mField->which()) {
-                case 0:
-                    return getCast<bool>(mField->get<std::string>());
-                case 1:
-                    return getCast<bool>(mField->get<float>());
-                case 2:
-                    return getCast<bool>(mField->get<bool>());
-                case 3:
-                    return getCast<bool>(mField->get<int>());
-
-            }
-        }
-
-        std::string getString() const {
-            switch(mField->which()) {
-                case 0:
-                    return getCast<std::string>(mField->get<std::string>());
-                case 1:
-                    return getCast<std::string>(mField->get<float>());
-                case 2:
-                    return getCast<std::string>(mField->get<bool>());
-                case 3:
-                    return getCast<std::string>(mField->get<int>());
-
-            }
-        }
-
-        template <class D>
+        template <typename D>
         void set(D &&data) {
             if(std::is_same<D, bool>::value || std::is_same<D, int>::value ||
-                    std::is_same<D, float>::value || std::is_same<D, std::string>::value) {
+               std::is_same<D, float>::value || std::is_same<D, std::string>::value) {
                 mField->set<D>(std::forward<D>(data));
             }
             else {
-                throw stderr("Unsupported type");
+                std::cerr << "Unsupported type\n";
             };
         }

     private:
-        template <typename T>
-        T& getCast(T const &s) const {
-            return s;
+        CopyOnWrite<SettingsType> mField;
+    };
+
+    template<>
+    int Property::get<int>() const {
+        int id = mField->which();
+        switch(id){
+            case 0:
+                return std::stoi(mField->get<std::string>());
+            case 1:
+                return (int)mField->get<float>();
+            case 2:
+                return (int)mField->get<bool>();
+            case 3:
+                return mField->get<int>();
         }

-//        template<>
-        int getCast<int>(std::string const &s) const {
-            return atoi(s);
+    }
+
+    template<>
+    float Property::get<float>() const {
+        int id = mField->which();
+        switch(id){
+            case 0:
+                return std::stof(mField->get<std::string>());
+            case 1:
+                return mField->get<float>();
+            case 2:
+                return (float)mField->get<bool>();
+            case 3:
+                return (float)mField->get<int>();
         }
+    }

-//        template<>
-        float getCast<float>(std::string const &s) const {
-            return std::stof(s);
+    template<>
+    bool Property::get<bool>() const {
+        int id = mField->which();
+        switch(id){
+            case 0:
+                bool res;
+                std::istringstream(mField->get<std::string>()) >> std::boolalpha >> res;
+                return res;
+            case 1:
+                return (bool)mField->get<float>();
+            case 2:
+                return mField->get<bool>();
+            case 3:
+                return (bool)mField->get<int>();
         }
+    }

-//        template<>
-        bool getCast<bool>(std::string const &s) const {
-            bool res;
-            std::istringstream(s) >> std::boolalpha >> res;
-            return res;
+    template<>
+    std::string Property::get<std::string>() const {
+        int id = mField->which();
+        switch(id){
+            case 0:
+                return mField->get<std::string>();
+            case 1:
+                return std::to_string(mField->get<float>());
+            case 2:
+                return std::to_string(mField->get<bool>());
+            case 3:
+                return std::to_string(mField->get<int>());
         }
+    }

-        template<typename, typename D, class = typename std::enable_if<std::is_arithmetic<D>::value>::type>
-        std::string getCast<std::string>(D &const n) const {
-            return std::to_string(n);
-        };
+    int Property::getInt() {
+        this->get<int>();
+    }

-        template <typename T, class = typename std::enable_if<std::is_arithmetic<T>::value>::type,
-                typename D, class = typename std::enable_if<std::is_arithmetic<D>::value>::type>
-        std::string getCast<T>(D &const n) const {
-            return T(n);
-        };
-//        union float_bool_str {
-//            std::string m_string;
-//            float mfloat;
-//            bool m_bool;
-//            float_bool_str(std::string str) {
-//                new (&m_string) std::string(str);
-//            }
-//            ~float_bool_str() {
-//                m_string.~string();
-//            }
-//        };
-        CopyOnWrite<SettingsType> mField;
-    };
+    float Property::getFloat() {
+        this->get<float>();
+    }
+    bool Property::getBool() {
+        this->get<bool>();
+    }
+
+    std::string Property::getString() {
+        this->get<std::string>();
+    }
 }
+


Update version for release

Update version for release

--- include/siri/version.h
+++ include/siri/version.h
@@ -15,7 +15,7 @@
  * Note that debian alpha packages should use versions like this:
  *   2.0.34-0alpha0
  */
-#define SIRIDB_VERSION_PRE_RELEASE "-alpha-6"
+#define SIRIDB_VERSION_PRE_RELEASE ""

 #ifndef NDEBUG
 #define SIRIDB_VERSION_BUILD_RELEASE "+debug"