V4L/DVB (11979): em28xx: don't create audio device if not supported

In cases where the device does not actually provide a USB audio class *or*
vendor audio, do not load the driver that provides vendor audio support (such
as the KWorld 2800d).  Otherwise, the /dev/audio1 device file gets created and
users get confused.

Also, reworks the logic a bit so that we don't try to inspect the register
content if the register read failed entirely.

Signed-off-by: Devin Heitmueller <039f3b3c9b432027eb8868e4a734444e1ca005b6@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>

--- drivers/media/video/em28xx/em28xx-core.c
+++ drivers/media/video/em28xx/em28xx-core.c
@@ -500,18 +500,21 @@

 	/* See how this device is configured */
 	cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG);
-	if (cfg < 0)
+	em28xx_info("Config register raw data: 0x%02x\n", cfg);
+	if (cfg < 0) {
+		/* Register read error?  */
 		cfg = EM28XX_CHIPCFG_AC97; /* Be conservative */
-	else
-		em28xx_info("Config register raw data: 0x%02x\n", cfg);
-
-	if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
-		    EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
+	} else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) == 0x00) {
+		/* The device doesn't have vendor audio at all */
+		dev->has_alsa_audio = 0;
+		dev->audio_mode.has_audio = 0;
+		return 0;
+	} else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
+		   EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
 		em28xx_info("I2S Audio (3 sample rates)\n");
 		dev->audio_mode.i2s_3rates = 1;
-	}
-	if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
-		    EM28XX_CHIPCFG_I2S_5_SAMPRATES) {
+	} else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
+		   EM28XX_CHIPCFG_I2S_5_SAMPRATES) {
 		em28xx_info("I2S Audio (5 sample rates)\n");
 		dev->audio_mode.i2s_5rates = 1;
 	}


* change to ANSI C style.

* change to ANSI C style.

--- gtksourceview2/ext/gtksourceview2/rbgtksourceprintcompositor.c
+++ gtksourceview2/ext/gtksourceview2/rbgtksourceprintcompositor.c
@@ -25,8 +25,7 @@
  * Returns: the new print compositor object.
  */
 static VALUE
-sprintcompositor_initialize (self, val)
-    VALUE self, val;
+sprintcompositor_initialize(VALUE self, VALUE val)
 {
     if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_TYPE_SOURCE_BUFFER))) {
        G_INITIALIZE(self,
@@ -101,68 +100,59 @@
 */

 static VALUE
-sprintcompositor_get_top_margin(self, unit)
-    VALUE self, unit;
+sprintcompositor_get_top_margin(VALUE self, VALUE unit)
 {
     return DBL2NUM(gtk_source_print_compositor_get_top_margin(_SELF(self), RVAL2UNIT (unit)));
 }

 static VALUE
-sprintcompositor_set_top_margin(self, top, unit)
-    VALUE self, top, unit;
+sprintcompositor_set_top_margin(VALUE self, VALUE top, VALUE unit)
 {
     gtk_source_print_compositor_set_top_margin(_SELF(self), NUM2DBL(top), RVAL2UNIT (unit));
     return self;
 }

 static VALUE
-sprintcompositor_get_bottom_margin(self, unit)
-    VALUE self, unit;
+sprintcompositor_get_bottom_margin(VALUE self, VALUE unit)
 {
     return DBL2NUM(gtk_source_print_compositor_get_bottom_margin(_SELF(self), RVAL2UNIT (unit)));
 }

 static VALUE
-sprintcompositor_set_bottom_margin(self, bottom, unit)
-    VALUE self, bottom, unit;
+sprintcompositor_set_bottom_margin(VALUE self, VALUE bottom, VALUE unit)
 {
     gtk_source_print_compositor_set_bottom_margin(_SELF(self), NUM2DBL(bottom), RVAL2UNIT (unit));
     return self;
 }

 static VALUE
-sprintcompositor_get_left_margin(self, unit)
-    VALUE self, unit;
+sprintcompositor_get_left_margin(VALUE self, VALUE unit)
 {
     return DBL2NUM(gtk_source_print_compositor_get_left_margin(_SELF(self), RVAL2UNIT (unit)));
 }

 static VALUE
-sprintcompositor_set_left_margin(self, left, unit)
-    VALUE self, left, unit;
+sprintcompositor_set_left_margin(VALUE self, VALUE left, VALUE unit)
 {
     gtk_source_print_compositor_set_left_margin(_SELF(self), NUM2DBL(left), RVAL2UNIT (unit));
     return self;
 }

 static VALUE
-sprintcompositor_get_right_margin(self, unit)
-    VALUE self, unit;
+sprintcompositor_get_right_margin(VALUE self, VALUE unit)
 {
     return DBL2NUM(gtk_source_print_compositor_get_right_margin(_SELF(self), RVAL2UNIT (unit)));
 }

 static VALUE
-sprintcompositor_set_right_margin(self, right, unit)
-    VALUE self, right, unit;
+sprintcompositor_set_right_margin(VALUE self, VALUE right, VALUE unit)
 {
     gtk_source_print_compositor_set_right_margin(_SELF(self), NUM2DBL(right), RVAL2UNIT (unit));
     return self;
 }

 static VALUE
-sprintcompositor_set_header_format(self, separator, left, center, right)
-    VALUE self, separator, left, center, right;
+sprintcompositor_set_header_format(VALUE self, VALUE separator, VALUE left, VALUE center, VALUE right)
 {
     gtk_source_print_compositor_set_header_format(_SELF(self),
                                            RVAL2CBOOL(separator),
@@ -173,8 +163,7 @@
 }

 static VALUE
-sprintcompositor_set_footer_format(self, separator, left, center, right)
-    VALUE self, separator, left, center, right;
+sprintcompositor_set_footer_format(VALUE self, VALUE separator, VALUE left, VALUE center, VALUE right)
 {
     gtk_source_print_compositor_set_footer_format(_SELF(self),
                                            RVAL2CBOOL(separator),
@@ -185,23 +174,20 @@
 }

 static VALUE
-sprintcompositor_paginate (self, context)
-    VALUE self, context;
+sprintcompositor_paginate(VALUE self, VALUE context)
 {
     return CBOOL2RVAL (gtk_source_print_compositor_paginate (_SELF (self),
                                         GTK_PRINT_CONTEXT (RVAL2GOBJ (context))));
 }

 static VALUE
-sprintcompositor_get_pagination_progress (self)
-    VALUE self;
+sprintcompositor_get_pagination_progress(VALUE self)
 {
     return DBL2NUM (gtk_source_print_compositor_get_pagination_progress (_SELF (self)));
 }

 static VALUE
-sprintcompositor_draw_page (self, context, page_nr)
-    VALUE self, context, page_nr;
+sprintcompositor_draw_page(VALUE self, VALUE context, VALUE page_nr)
 {
     gtk_source_print_compositor_draw_page (_SELF (self),
                                            GTK_PRINT_CONTEXT (RVAL2GOBJ (context)),


Cluster: perform orphaned masters check before continue statements.

The check was placed in a way that conflicted with the continue
statements used by the node hearth beat code later that needs to skip
the current node sometimes. Moved at the start of the function so that's
always executed.

--- src/cluster.c
+++ src/cluster.c
@@ -2312,6 +2312,17 @@
             (REDIS_NODE_MYSELF|REDIS_NODE_NOADDR|REDIS_NODE_HANDSHAKE))
                 continue;

+        /* Orphaned master check, useful only if the current instance
+         * is a slave that may migrate to another master. */
+        if (nodeIsSlave(myself) && nodeIsMaster(node) && !nodeFailed(node)) {
+            int okslaves = clusterCountNonFailingSlaves(node);
+
+            if (okslaves == 0) orphaned_masters++;
+            if (okslaves > max_slaves) max_slaves = okslaves;
+            if (nodeIsSlave(myself) && myself->slaveof == node)
+                this_slaves = okslaves;
+        }
+
         /* If we are waiting for the PONG more than half the cluster
          * timeout, reconnect the link: maybe there is a connection
          * issue even if the node is alive. */
@@ -2356,17 +2367,6 @@
                 node->flags |= REDIS_NODE_PFAIL;
                 update_state = 1;
             }
-        }
-
-        /* Orphaned master check, useful only if the current instance
-         * is a slave that may migrate to another master. */
-        if (nodeIsSlave(myself) && nodeIsMaster(node) && !nodeFailed(node)) {
-            int okslaves = clusterCountNonFailingSlaves(node);
-
-            if (okslaves == 0) orphaned_masters++;
-            if (okslaves > max_slaves) max_slaves = okslaves;
-            if (nodeIsSlave(myself) && myself->slaveof == node)
-                this_slaves = okslaves;
         }
     }
     dictReleaseIterator(di);


clock: provide placement orientation and width-for-height and vice-versa.

If no minimum size is provided in the group, it will allocate the
height (for horizontal shelves) or width (for vertical shelves) and
then calculate the required size of the gadget.

It will also send messages to notify the gadget about it's
orientation, if horizontal, vertical or floating. This way it can
adapt its "fit" and relative-to properly.

NOTE: depends on Edje at revision greater than r62640.

SVN revision: 62641

--- src/modules/clock/e_mod_main.c
+++ src/modules/clock/e_mod_main.c
@@ -321,6 +321,78 @@
    e_gadcon_popup_show(inst->popup);
 }

+static void
+_eval_instance_size(Instance *inst)
+{
+   Evas_Coord mw, mh, omw, omh;
+
+   edje_object_size_min_get(inst->o_clock, &mw, &mh);
+   omw = mw;
+   omh = mh;
+
+   if ((mw < 1) || (mh < 1))
+     {
+        Evas_Coord x, y, sw = 0, sh = 0, ow, oh;
+        Eina_Bool horiz;
+        const char *orient;
+
+        switch (inst->gcc->gadcon->orient)
+          {
+           case E_GADCON_ORIENT_TOP:
+           case E_GADCON_ORIENT_CORNER_TL:
+           case E_GADCON_ORIENT_CORNER_TR:
+           case E_GADCON_ORIENT_BOTTOM:
+           case E_GADCON_ORIENT_CORNER_BL:
+           case E_GADCON_ORIENT_CORNER_BR:
+           case E_GADCON_ORIENT_HORIZ:
+              horiz = EINA_TRUE;
+              orient = "e,state,horizontal";
+              break;
+
+           case E_GADCON_ORIENT_LEFT:
+           case E_GADCON_ORIENT_CORNER_LB:
+           case E_GADCON_ORIENT_CORNER_LT:
+           case E_GADCON_ORIENT_RIGHT:
+           case E_GADCON_ORIENT_CORNER_RB:
+           case E_GADCON_ORIENT_CORNER_RT:
+           case E_GADCON_ORIENT_VERT:
+              horiz = EINA_FALSE;
+              orient = "e,state,vertical";
+              break;
+
+           default:
+              horiz = EINA_TRUE;
+              orient = "e,state,float";
+          }
+
+        if (inst->gcc->gadcon->shelf)
+          {
+             if (horiz)
+               sh = inst->gcc->gadcon->shelf->h;
+             else
+               sw = inst->gcc->gadcon->shelf->w;
+          }
+
+        evas_object_geometry_get(inst->o_clock, NULL, NULL, &ow, &oh);
+        if (orient)
+          edje_object_signal_emit(inst->o_clock, orient, "e");
+        evas_object_resize(inst->o_clock, sw, sh);
+        edje_object_message_signal_process(inst->o_clock);
+
+        edje_object_parts_extends_calc(inst->o_clock, &x, &y, &mw, &mh);
+        evas_object_resize(inst->o_clock, ow, oh);
+     }
+
+   if (mw < 4) mw = 4;
+   if (mh < 4) mh = 4;
+
+   if (mw < omw) mw = omw;
+   if (mh < omh) mh = omh;
+
+   e_gadcon_client_aspect_set(inst->gcc, mw, mh);
+   e_gadcon_client_min_size_set(inst->gcc, mw, mh);
+}
+
 void
 e_int_clock_instances_redo(void)
 {
@@ -337,8 +409,6 @@
    EINA_LIST_FOREACH(clock_instances, l, inst)
      {
         Evas_Object *o = inst->o_clock;
-        Evas_Coord mw, mh;
-

         if (inst->cfg->digital_clock)
            e_theme_edje_object_set(o, "base/theme/modules/clock",
@@ -356,15 +426,7 @@
            edje_object_signal_emit(o, "e,state,seconds,off", "e");

         edje_object_part_text_set(o, "e.text.today", todaystr);
-        edje_object_message_signal_process(o);
-        mw = 0, mh = 0;
-        edje_object_size_min_get(o, &mw, &mh);
-        if ((mw < 1) || (mh < 1))
-           edje_object_size_min_calc(o, &mw, &mh);
-        if (mw < 4) mw = 4;
-        if (mh < 4) mh = 4;
-        e_gadcon_client_aspect_set(inst->gcc, mw, mh);
-        e_gadcon_client_min_size_set(inst->gcc, mw, mh);
+        _eval_instance_size(inst);

         if (inst->o_popclock)
           {
@@ -386,7 +448,6 @@
                edje_object_signal_emit(o, "e,state,seconds,off", "e");

              edje_object_part_text_set(o, "e.text.today", todaystr);
-             edje_object_message_signal_process(o);
           }
      }
 }
@@ -492,20 +553,11 @@
                                  EVAS_BUTTON_NONE, ev->timestamp, NULL);
      }
 }
+
 static void
 _clock_sizing_changed_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
 {
-   Instance *inst = data;
-   Evas_Coord mw, mh;
-
-   mw = 0, mh = 0;
-   edje_object_size_min_get(inst->o_clock, &mw, &mh);
-   if ((mw < 1) || (mh < 1))
-     edje_object_size_min_calc(inst->o_clock, &mw, &mh);
-   if (mw < 4) mw = 4;
-   if (mh < 4) mh = 4;
-   e_gadcon_client_aspect_set(inst->gcc, mw, mh);
-   e_gadcon_client_min_size_set(inst->gcc, mw, mh);
+   _eval_instance_size(data);
 }

 static E_Gadcon_Client *
@@ -592,18 +644,7 @@
 static void
 _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
 {
-   Instance *inst;
-   Evas_Coord mw, mh;
-
-   inst = gcc->data;
-   mw = 0, mh = 0;
-   edje_object_size_min_get(inst->o_clock, &mw, &mh);
-   if ((mw < 1) || (mh < 1))
-     edje_object_size_min_calc(inst->o_clock, &mw, &mh);
-   if (mw < 4) mw = 4;
-   if (mh < 4) mh = 4;
-   e_gadcon_client_aspect_set(gcc, mw, mh);
-   e_gadcon_client_min_size_set(gcc, mw, mh);
+   _eval_instance_size(gcc->data);
 }

 static char *


var_expand*(): Added small unit tests for %H and %N

--- src/lib/test-var-expand.c
+++ src/lib/test-var-expand.c
@@ -21,9 +21,15 @@
 	static struct var_expand_test tests[] = {
 		{ "%{hostname}", NULL },
 		{ "%{pid}", NULL },
-		{ "a%{env:FOO}b", "abaRb" }
+		{ "a%{env:FOO}b", "abaRb" },
+		{ "%50Hv", "1f" },
+		{ "%50Hw", "2e" },
+		{ "%50Nv", "25" },
+		{ "%50Nw", "e" }
 	};
 	static struct var_expand_table table[] = {
+		{ 'v', "value", NULL },
+		{ 'w', "value2", NULL },
 		{ '\0', NULL, NULL }
 	};
 	string_t *str = t_str_new(128);


V4L/DVB: zoran: cleanup pointer condition

Remove the following sparse warning (see "make C=1"):
 * warning: Using plain integer as NULL pointer

Signed-off-by: Márton Németh <8fdce27e837180693215edc025691c83b7d5795b@freemail.hu>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>

--- drivers/media/video/zoran/zoran_driver.c
+++ drivers/media/video/zoran/zoran_driver.c
@@ -324,7 +324,7 @@
 		/* Allocate fragment table for this buffer */

 		mem = (void *)get_zeroed_page(GFP_KERNEL);
-		if (mem == 0) {
+		if (!mem) {
 			dprintk(1,
 				KERN_ERR
 				"%s: %s - get_zeroed_page (frag_tab) failed for buffer %d\n",


Cluster: use clusterSetNodeAsMaster() during slave failover.

clusterHandleSlaveFailover() was reimplementing what
clusterSetNodeAsMaster() without any good reason.

--- src/cluster.c
+++ src/cluster.c
@@ -2504,10 +2504,7 @@
          * this slave to a master.
          *
          * 1) Turn this node into a master. */
-        clusterNodeRemoveSlave(myself->slaveof, myself);
-        myself->flags &= ~REDIS_NODE_SLAVE;
-        myself->flags |= REDIS_NODE_MASTER;
-        myself->slaveof = NULL;
+        clusterSetNodeAsMaster(myself);
         replicationUnsetMaster();

         /* 2) Claim all the slots assigned to our master. */


unset comp win effect when dragging a window to the current desk

--- src/modules/pager/e_mod_main.c
+++ src/modules/pager/e_mod_main.c
@@ -2009,7 +2009,11 @@
         desk = e_desk_current_get(zone);

         e_border_zone_set(pw->border, zone);
-        e_border_desk_set(pw->border, desk);
+        if ((pw->border->desk != desk) && (desk == e_desk_current_get(zone)))
+          {
+             e_border_desk_set(pw->border, desk);
+             e_comp_win_effect_set(pw->border->cw, NULL);
+          }

         ecore_x_pointer_last_xy_get(&x, &y);


V4L/DVB (11237): media/zoran: fix printk format

Fix printk format warning:

drivers/media/video/zoran/zoran_driver.c:345: warning: format '%lx'
expects type 'long unsigned int', but argument 5 has type 'phys_addr_t'

Signed-off-by: Randy Dunlap <e1d10faa7e2a0c027bf1ff1d20e7fd10154be7ea@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>

--- drivers/media/video/zoran/zoran_driver.c
+++ drivers/media/video/zoran/zoran_driver.c
@@ -245,9 +245,9 @@
 			SetPageReserved(virt_to_page(mem + off));
 		dprintk(4,
 			KERN_INFO
-			"%s: %s - V4L frame %d mem 0x%lx (bus: 0x%lx)\n",
+			"%s: %s - V4L frame %d mem 0x%lx (bus: 0x%llx)\n",
 			ZR_DEVNAME(zr), __func__, i, (unsigned long) mem,
-			virt_to_bus(mem));
+			(unsigned long long)virt_to_bus(mem));
 	}

 	fh->buffers.allocated = 1;


cluster process publish message only for known nodes. (#8856)

--- src/cluster.c
+++ src/cluster.c
@@ -2148,6 +2148,8 @@
                 hdr->sender, hdr->data.fail.about.nodename);
         }
     } else if (type == CLUSTERMSG_TYPE_PUBLISH) {
+        if (!sender) return 1;  /* We don't know that node. */
+
         robj *channel, *message;
         uint32_t channel_len, message_len;


asm/nasm.c: Drop tabs

asm/nasm.c: Drop tabs

Signed-off-by: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@gmail.com>

--- asm/nasm.c
+++ asm/nasm.c
@@ -104,7 +104,7 @@
 bool tasm_compatible_mode = false;
 int pass0;
 int64_t passn;
-static int pass1, pass2;	/* XXX: Get rid of these, they are redundant */
+static int pass1, pass2;    /* XXX: Get rid of these, they are redundant */
 int globalrel = 0;
 int globalbnd = 0;

@@ -493,7 +493,7 @@
         dfmt = &null_debug_form;
     } else if (!debug_format) {
         /* Default debug format for this backend */
-	dfmt = ofmt->default_dfmt;
+        dfmt = ofmt->default_dfmt;
     } else {
         dfmt = dfmt_find(ofmt, debug_format);
         if (!dfmt) {
@@ -569,8 +569,8 @@
             /* pass = 1; */
             preproc->reset(inname, 3, depend_list);

-	    /* Revert all warnings to the default state */
-	    memcpy(warning_state, warning_state_init, sizeof warning_state);
+            /* Revert all warnings to the default state */
+            memcpy(warning_state, warning_state_init, sizeof warning_state);

             while ((line = preproc->getline())) {
                 /*
@@ -1434,22 +1434,22 @@
         pass2 = passn > 1  ? 2 : 1;     /* 1, 2, 2, ..., 2, 2 */
         /* pass0                           0, 0, 0, ..., 1, 2 */

-	/*
-	 * Create a warning buffer list unless we are in pass 2 (everything will be
-	 * emitted immediately in pass 2.)
-	 */
-	if (warn_list) {
+        /*
+         * Create a warning buffer list unless we are in pass 2 (everything will be
+         * emitted immediately in pass 2.)
+         */
+        if (warn_list) {
             if (warn_list->nstr || pass0 == 2)
                 strlist_free(&warn_list);
-	}
-
-	if (pass0 < 2 && !warn_list)
-		warn_list = strlist_alloc(false);
+        }
+
+        if (pass0 < 2 && !warn_list)
+            warn_list = strlist_alloc(false);

         globalbits = cmd_sb;  /* set 'bits' to command line default */
         cpu = cmd_cpu;
         if (pass0 == 2) {
-	    lfmt->init(listname);
+            lfmt->init(listname);
         } else if (passn == 1 && listname && !keep_all) {
             /* Remove the list file in case we die before the output pass */
             remove(listname);
@@ -1470,15 +1470,15 @@
         switch_segment(ofmt->section(NULL, pass2, &globalbits));
         preproc->reset(fname, pass1, pass1 == 2 ? depend_list : NULL);

-	/* Revert all warnings to the default state */
-	memcpy(warning_state, warning_state_init, sizeof warning_state);
+        /* Revert all warnings to the default state */
+        memcpy(warning_state, warning_state_init, sizeof warning_state);

         globallineno = 0;

         while ((line = preproc->getline())) {
             if (++globallineno > nasm_limit[LIMIT_LINES])
                 nasm_fatal("overall line count exceeds the maximum %"PRId64"\n",
-			   nasm_limit[LIMIT_LINES]);
+                           nasm_limit[LIMIT_LINES]);

             /*
              * Here we parse our directives; this is not handled by the
@@ -1749,7 +1749,7 @@
      * resumed from.
      */
     if ((severity & ERR_MASK) >= ERR_FATAL)
-	return false;
+        return false;

     /*
      * passn is 1 on the very first pass only.
@@ -1757,7 +1757,7 @@
      * These are the passes we care about in this case.
      */
     return (((severity & ERR_PASS1) && passn != 1) ||
-	    ((severity & ERR_PASS2) && pass0 != 2));
+            ((severity & ERR_PASS2) && pass0 != 2));
 }

 /**
@@ -1828,7 +1828,7 @@
         return;

     if (!(severity & ERR_NOFILE)) {
-	src_get(&lineno, &currentfile);
+        src_get(&lineno, &currentfile);
         if (!currentfile) {
             currentfile = currentfile ? currentfile :
                 inname && inname[0] ? inname :
@@ -1853,7 +1853,7 @@
     vsnprintf(msg, sizeof msg, fmt, args);
     *warnsuf = 0;
     if (spec_type == ERR_WARNING) {
-	snprintf(warnsuf, sizeof warnsuf, " [-w+%s%s]",
+        snprintf(warnsuf, sizeof warnsuf, " [-w+%s%s]",
                  (true_type >= ERR_NONFATAL) ? "error=" : "",
                  warning_name[warn_index(severity)]);
     }
@@ -1865,34 +1865,34 @@
     }

     if (!skip_this_pass(severity)) {
-	    const char *file = currentfile ? currentfile : "nasm";
-	    const char *here = (severity & ERR_HERE) ? " here" : "";
-
-	    if (warn_list && true_type < ERR_NONFATAL) {
-		    /*
-		     * Buffer up warnings until we either get an error
-		     * or we are on the code-generation pass.
-		     */
-		    strlist_printf(warn_list, "%s%s%s%s%s%s%s",
-				   file, linestr, errfmt->beforemsg,
-				   pfx, msg, here, warnsuf);
-	    } else {
-		    /* If we have buffered warnings, output them now. */
-		    if (warn_list) {
-			    strlist_write(warn_list, "\n", error_file);
-			    strlist_free(&warn_list);
-		    }
-
-		    fprintf(error_file, "%s%s%s%s%s%s%s\n",
-			    file, linestr, errfmt->beforemsg,
-			    pfx, msg, here, warnsuf);
-
-	    }
+        const char *file = currentfile ? currentfile : "nasm";
+        const char *here = (severity & ERR_HERE) ? " here" : "";
+
+        if (warn_list && true_type < ERR_NONFATAL) {
+            /*
+             * Buffer up warnings until we either get an error
+             * or we are on the code-generation pass.
+             */
+            strlist_printf(warn_list, "%s%s%s%s%s%s%s",
+                           file, linestr, errfmt->beforemsg,
+                           pfx, msg, here, warnsuf);
+        } else {
+            /* If we have buffered warnings, output them now. */
+            if (warn_list) {
+                strlist_write(warn_list, "\n", error_file);
+                strlist_free(&warn_list);
+            }
+
+            fprintf(error_file, "%s%s%s%s%s%s%s\n",
+                    file, linestr, errfmt->beforemsg,
+                    pfx, msg, here, warnsuf);
+
+        }
     }

     /* Are we recursing from error_list_macros? */
     if (severity & ERR_PP_LISTMACRO)
-	return;
+        return;

     /*
      * Don't suppress this with skip_this_pass(), or we don't get
@@ -1944,7 +1944,7 @@
         fflush(NULL);

         if (abort_on_panic)
-            abort();		/* halt, catch fire, dump core/stop debugger */
+            abort();            /* halt, catch fire, dump core/stop debugger */

         if (ofile) {
             fclose(ofile);


use consistent style to iterate over MP_env_const_vars

git-svn-id: b4be4a41b2a3352907de631eb6da1671a2f7b614@68710 13f79535-47bb-0310-9956-ffa450edef68

--- src/modules/perl/modperl_env.c
+++ src/modules/perl/modperl_env.c
@@ -63,17 +63,16 @@

 void modperl_env_default_populate(pTHX)
 {
+    modperl_env_ent_t *ent = MP_env_const_vars;
     HV *hv = ENVHV;
     U32 mg_flags;
-    int i;

     modperl_env_untie(mg_flags);

-    for (i = 0; MP_env_const_vars[i].key; i++) {
-        const modperl_env_ent_t *ent = &MP_env_const_vars[i];
-
+    while (ent->key) {
         hv_store(hv, ent->key, ent->klen,
                  newSVpvn(ent->val, ent->vlen), ent->hash);
+        ent++;
     }

     modperl_env_tie(mg_flags);


net: gianfar: no need to check parameter being != NULL for of_node_put

of_node_put is a noop when being called with NULL.

Signed-off-by: Uwe Kleine-König <181323dd666a182bc2d953e52d0ac3ab54cd8391@pengutronix.de>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/ethernet/freescale/gianfar.c
+++ drivers/net/ethernet/freescale/gianfar.c
@@ -1435,10 +1435,8 @@
 	unmap_group_regs(priv);
 	gfar_free_rx_queues(priv);
 	gfar_free_tx_queues(priv);
-	if (priv->phy_node)
-		of_node_put(priv->phy_node);
-	if (priv->tbi_node)
-		of_node_put(priv->tbi_node);
+	of_node_put(priv->phy_node);
+	of_node_put(priv->tbi_node);
 	free_gfar_dev(priv);
 	return err;
 }
@@ -1447,10 +1445,8 @@
 {
 	struct gfar_private *priv = platform_get_drvdata(ofdev);

-	if (priv->phy_node)
-		of_node_put(priv->phy_node);
-	if (priv->tbi_node)
-		of_node_put(priv->tbi_node);
+	of_node_put(priv->phy_node);
+	of_node_put(priv->tbi_node);

 	unregister_netdev(priv->ndev);
 	unmap_group_regs(priv);


[analyzer] Provide a symmetric method for generating a PathDiagnosticLocation from Decl

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@337211 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
+++ include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
@@ -216,6 +216,15 @@
   static PathDiagnosticLocation createBegin(const Decl *D,
                                             const SourceManager &SM);

+  /// Create a location for the beginning of the declaration.
+  /// The third argument is ignored, useful for generic treatment
+  /// of statements and declarations.
+  static PathDiagnosticLocation
+  createBegin(const Decl *D, const SourceManager &SM,
+              const LocationOrAnalysisDeclContext LAC) {
+    return createBegin(D, SM);
+  }
+
   /// Create a location for the beginning of the statement.
   static PathDiagnosticLocation createBegin(const Stmt *S,
                                             const SourceManager &SM,


Remove trailing spaces from cluster.c file.

--- src/cluster.c
+++ src/cluster.c
@@ -102,7 +102,7 @@
     struct stat sb;
     char *line;
     int maxline, j;
-
+
     if (fp == NULL) {
         if (errno == ENOENT) {
             return REDIS_ERR;
@@ -311,7 +311,7 @@
         (unsigned long long) server.cluster->currentEpoch,
         (unsigned long long) server.cluster->lastVoteEpoch);
     content_size = sdslen(ci);
-
+
     if ((fd = open(server.cluster_configfile,O_WRONLY|O_CREAT,0644))
         == -1) goto err;

@@ -751,7 +751,7 @@
 /* Add a node to the nodes hash table */
 int clusterAddNode(clusterNode *node) {
     int retval;
-
+
     retval = dictAdd(server.cluster->nodes,
             sdsnewlen(node->name,REDIS_CLUSTER_NAMELEN), node);
     return (retval == DICT_OK) ? REDIS_OK : REDIS_ERR;
@@ -814,7 +814,7 @@
 void clusterRenameNode(clusterNode *node, char *newname) {
     int retval;
     sds s = sdsnewlen(node->name, REDIS_CLUSTER_NAMELEN);
-
+
     redisLog(REDIS_DEBUG,"Renaming node %.40s into %.40s",
         node->name, newname);
     retval = dictDelete(server.cluster->nodes, s);
@@ -1783,7 +1783,7 @@
 /* This function is called when we detect the link with this node is lost.
    We set the node as no longer connected. The Cluster Cron will detect
    this connection and will try to get it connected again.
-
+
    Instead if the node is a temporary node used to accept a query, we
    completely free the node on error. */
 void handleLinkIOError(clusterLink *link) {
@@ -1893,7 +1893,7 @@

 /* Send a message to all the nodes that are part of the cluster having
  * a connected link.
- *
+ *
  * It is guaranteed that this function will never have as a side effect
  * some node->link to be invalidated, so it is safe to call this function
  * from event handlers that will do stuff with node links later. */
@@ -1987,7 +1987,7 @@
     if (link->node && type == CLUSTERMSG_TYPE_PING)
         link->node->ping_sent = mstime();
     clusterBuildMessageHdr(hdr,type);
-
+
     /* Populate the gossip fields */
     while(freshnodes > 0 && gossipcount < 3) {
         dictEntry *de = dictGetRandomKey(server.cluster->nodes);
@@ -3052,7 +3052,7 @@
      * of the netsplit because of lack of majority. */
     {
         int needed_quorum = (server.cluster->size / 2) + 1;
-
+
         if (unreachable_masters >= needed_quorum) {
             new_state = REDIS_CLUSTER_FAIL;
             among_minority_time = mstime();
@@ -4028,7 +4028,7 @@
         addReplySds(c,sdsnew("+NOKEY\r\n"));
         return;
     }
-
+
     /* Connect */
     fd = migrateGetSocket(c,c->argv[1],c->argv[2],timeout);
     if (fd == -1) return; /* error sent to the client by migrateGetSocket() */


Fix regression using dynamictext with pango.

Regression in d0d0392
See #467

--- src/modules/plus/filter_text.c
+++ src/modules/plus/filter_text.c
@@ -40,9 +40,8 @@
 	}
 }

-static void setup_producer( mlt_filter filter, mlt_producer producer )
-{
-	mlt_properties my_properties = MLT_FILTER_PROPERTIES( filter );
+static void setup_producer( mlt_producer producer, mlt_properties my_properties )
+{
 	mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );

 	// Pass the properties to the text producer
@@ -58,9 +57,8 @@
 	mlt_properties_set( producer_properties, "align", mlt_properties_get( my_properties, "halign" ) );
 }

-static void setup_transition( mlt_filter filter, mlt_transition transition, mlt_frame frame )
-{
-	mlt_properties my_properties = MLT_FILTER_PROPERTIES( filter );
+static void setup_transition( mlt_filter filter, mlt_transition transition, mlt_frame frame, mlt_properties my_properties )
+{
 	mlt_properties transition_properties = MLT_TRANSITION_PROPERTIES( transition );
 	mlt_position position = mlt_filter_get_position( filter, frame );
 	mlt_position length = mlt_filter_get_length2( filter, frame );
@@ -80,6 +78,13 @@
 	mlt_service_unlock( MLT_TRANSITION_SERVICE(transition) );
 }

+static mlt_properties get_filter_properties( mlt_filter filter, mlt_frame frame )
+{
+	mlt_properties properties = mlt_frame_get_unique_properties( frame, MLT_FILTER_SERVICE(filter) );
+	if ( !properties )
+		properties = MLT_FILTER_PROPERTIES(filter);
+	return properties;
+}

 /** Get the image.
 */
@@ -88,18 +93,19 @@
 	int error = 0;
 	mlt_filter filter = mlt_frame_pop_service( frame );
 	char* argument = (char*)mlt_frame_pop_service( frame );
-	mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
-	mlt_producer producer = mlt_properties_get_data( properties, "_producer", NULL );
-	mlt_transition transition = mlt_properties_get_data( properties, "_transition", NULL );
+	mlt_properties my_properties = MLT_FILTER_PROPERTIES( filter );
+	mlt_properties properties = get_filter_properties( filter, frame );
+	mlt_producer producer = mlt_properties_get_data( my_properties, "_producer", NULL );
+	mlt_transition transition = mlt_properties_get_data( my_properties, "_transition", NULL );
 	mlt_frame b_frame = 0;
 	mlt_position position = 0;

 	// Configure this filter
 	mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
-	if( mlt_properties_get_int( properties, "_reset" ) )
-	{
-		setup_producer( filter, producer );
-		setup_transition( filter, transition, frame );
+	if( mlt_properties_get_int( my_properties, "_reset" ) )
+	{
+		setup_producer( producer, properties );
+		setup_transition( filter, transition, frame, properties );
 	}
 	mlt_properties_set( MLT_PRODUCER_PROPERTIES( producer ), "text", argument );

@@ -147,7 +153,7 @@
 */
 static mlt_frame filter_process( mlt_filter filter, mlt_frame frame )
 {
-	mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+	mlt_properties properties = get_filter_properties( filter, frame );
 	char* argument = mlt_properties_get( properties, "argument" );
 	if ( !argument || !strcmp( "", argument ) )
 		return frame;


iwlegacy: don't mess up the SCD when removing a key

When we remove a key, we put a key index which was supposed
to tell the fw that we are actually removing the key. But
instead the fw took that index as a valid index and messed
up the SRAM of the device.

This memory corruption on the device mangled the data of
the SCD. The impact on the user is that SCD queue 2 got
stuck after having removed keys.

Reported-by: Paul Bolle <0bda9a89324ffe2d19adec61a9f1cd9f8c8e45f0@tiscali.nl>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <643a80aaf16a8332d6a70921c14d4bb265446494@intel.com>
Signed-off-by: Stanislaw Gruszka <1542dc81552e668e197a396f69e655c1621c300d@redhat.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/iwlegacy/4965-mac.c
+++ drivers/net/wireless/iwlegacy/4965-mac.c
@@ -3405,7 +3405,7 @@
 		return 0;
 	}

-	if (il->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) {
+	if (il->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_INVALID) {
 		IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx,
 			key_flags);
 		spin_unlock_irqrestore(&il->sta_lock, flags);
@@ -3420,7 +3420,7 @@
 	memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo));
 	il->stations[sta_id].sta.key.key_flags =
 	    STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID;
-	il->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET;
+	il->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx;
 	il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
 	il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;


freedreno/ir3: fix UCMP handling

freedreno/ir3: fix UCMP handling

UCMP does not require a compare, only a select.

Signed-off-by: Ilia Mirkin <bcbbb7aa705ec3a5fc5824c01a845186c3d62fca@alum.mit.edu>
Signed-off-by: Rob Clark <6f78cdb10adbe0a7fbbf4098125a51f401c77a5f@freedesktop.org>

--- src/gallium/drivers/freedreno/ir3/ir3_compiler.c
+++ src/gallium/drivers/freedreno/ir3/ir3_compiler.c
@@ -1477,9 +1477,6 @@
  * USLT(a,b) = (a < b) ? ~0 : 0
  *   cmps.u32.lt dst, a, b
  *
- * UCMP(a,b,c) = (a < 0) ? b : c
- *   cmps.u32.lt tmp0, a, {0}
- *   sel.b16 dst, b, tmp0, c
  */
 static void
 trans_icmp(const struct instr_translater *t,
@@ -1488,8 +1485,9 @@
 {
 	struct ir3_instruction *instr;
 	struct tgsi_dst_register *dst = get_dst(ctx, inst);
-	struct tgsi_src_register constval0;
-	struct tgsi_src_register *a0, *a1, *a2;
+	struct tgsi_dst_register tmp_dst;
+	struct tgsi_src_register *tmp_src;
+	struct tgsi_src_register *a0, *a1;
 	unsigned condition;

 	a0 = &inst->Src[0].Register;  /* a */
@@ -1510,12 +1508,6 @@
 	case TGSI_OPCODE_USLT:
 		condition = IR3_COND_LT;
 		break;
-	case TGSI_OPCODE_UCMP:
-		get_immediate(ctx, &constval0, 0);
-		a0 = &inst->Src[0].Register;  /* a */
-		a1 = &constval0;              /* {0} */
-		condition = IR3_COND_LT;
-		break;

 	default:
 		compile_assert(ctx, 0);
@@ -1525,35 +1517,45 @@
 	if (is_const(a0) && is_const(a1))
 		a0 = get_unconst(ctx, a0);

-	if (t->tgsi_opc == TGSI_OPCODE_UCMP) {
-		struct tgsi_dst_register tmp_dst;
-		struct tgsi_src_register *tmp_src;
-		tmp_src = get_internal_temp(ctx, &tmp_dst);
-		/* cmps.u32.lt tmp, a0, a1 */
-		instr = instr_create(ctx, 2, t->opc);
-		instr->cat2.condition = condition;
-		vectorize(ctx, instr, &tmp_dst, 2, a0, 0, a1, 0);
-
-		a1 = &inst->Src[1].Register;
-		a2 = &inst->Src[2].Register;
-		/* sel.{b32,b16} dst, src2, tmp, src1 */
-		instr = instr_create(ctx, 3, OPC_SEL_B32);
-		vectorize(ctx, instr, dst, 3, a1, 0, tmp_src, 0, a2, 0);
-	} else {
-		struct tgsi_dst_register tmp_dst;
-		struct tgsi_src_register *tmp_src;
-		tmp_src = get_internal_temp(ctx, &tmp_dst);
-		/* cmps.{u32,s32}.<cond> tmp, a0, a1 */
-		instr = instr_create(ctx, 2, t->opc);
-		instr->cat2.condition = condition;
-		vectorize(ctx, instr, &tmp_dst, 2, a0, 0, a1, 0);
-
-		/* absneg.s dst, (neg)tmp */
-		instr = instr_create(ctx, 2, OPC_ABSNEG_S);
-		vectorize(ctx, instr, dst, 1, tmp_src, IR3_REG_NEGATE);
-	}
+	tmp_src = get_internal_temp(ctx, &tmp_dst);
+	/* cmps.{u32,s32}.<cond> tmp, a0, a1 */
+	instr = instr_create(ctx, 2, t->opc);
+	instr->cat2.condition = condition;
+	vectorize(ctx, instr, &tmp_dst, 2, a0, 0, a1, 0);
+
+	/* absneg.s dst, (neg)tmp */
+	instr = instr_create(ctx, 2, OPC_ABSNEG_S);
+	vectorize(ctx, instr, dst, 1, tmp_src, IR3_REG_NEGATE);
+
 	put_dst(ctx, inst, dst);
 }
+
+/*
+ * UCMP(a,b,c) = a ? b : c
+ *   sel.b16 dst, b, a, c
+ */
+static void
+trans_ucmp(const struct instr_translater *t,
+		struct ir3_compile_context *ctx,
+		struct tgsi_full_instruction *inst)
+{
+	struct ir3_instruction *instr;
+	struct tgsi_dst_register *dst = get_dst(ctx, inst);
+	struct tgsi_src_register *a0, *a1, *a2;
+
+	a0 = &inst->Src[0].Register;  /* a */
+	a1 = &inst->Src[1].Register;  /* b */
+	a2 = &inst->Src[2].Register;  /* c */
+
+	if (is_rel_or_const(a0))
+		a0 = get_unconst(ctx, a0);
+
+	/* sel.{b32,b16} dst, b, a, c */
+	instr = instr_create(ctx, 3, OPC_SEL_B32);
+	vectorize(ctx, instr, dst, 3, a1, 0, a0, 0, a2, 0);
+	put_dst(ctx, inst, dst);
+}
+

 /*
  * Conditional / Flow control
@@ -2114,7 +2116,7 @@
 	INSTR(USGE,         trans_icmp, .opc = OPC_CMPS_U),
 	INSTR(ISLT,         trans_icmp, .opc = OPC_CMPS_S),
 	INSTR(USLT,         trans_icmp, .opc = OPC_CMPS_U),
-	INSTR(UCMP,         trans_icmp, .opc = OPC_CMPS_U),
+	INSTR(UCMP,         trans_ucmp),
 	INSTR(IF,           trans_if,   .opc = OPC_CMPS_F),
 	INSTR(UIF,          trans_if,   .opc = OPC_CMPS_U),
 	INSTR(ELSE,         trans_else),


Fix possible OOB read with empty path

Fix possible OOB read with empty path

--- src/libbluray/disc/disc.c
+++ src/libbluray/disc/disc.c
@@ -539,7 +539,7 @@

     /* plain directory ? */
     size = strlen(rel_path);
-    if (rel_path[size - 1] == '/' || rel_path[size - 1] == '\\') {
+    if (size < 1 || rel_path[size - 1] == '/' || rel_path[size - 1] == '\\') {
         return 0;
     }


Cluster: include node IDs in SLOTS output.

CLUSTER SLOTS now includes IDs in the nodes description associated with
a given slot range. Certain client libraries implementations need a way
to reference a node in an unique way, so they were relying on CLUSTER
NODES, that is not a stable API and may change frequently depending on
Redis Cluster future requirements.

--- src/cluster.c
+++ src/cluster.c
@@ -3774,8 +3774,10 @@
      *            2) end slot
      *            3) 1) master IP
      *               2) master port
+     *               3) node ID
      *            4) 1) replica IP
      *               2) replica port
+     *               3) node ID
      *           ... continued until done
      */

@@ -3816,18 +3818,20 @@
                 start = -1;

                 /* First node reply position is always the master */
-                addReplyMultiBulkLen(c, 2);
+                addReplyMultiBulkLen(c, 3);
                 addReplyBulkCString(c, node->ip);
                 addReplyLongLong(c, node->port);
+                addReplyBulkCBuffer(c, node->name, CLUSTER_NAMELEN);

                 /* Remaining nodes in reply are replicas for slot range */
                 for (i = 0; i < node->numslaves; i++) {
                     /* This loop is copy/pasted from clusterGenNodeDescription()
                      * with modifications for per-slot node aggregation */
                     if (nodeFailed(node->slaves[i])) continue;
-                    addReplyMultiBulkLen(c, 2);
+                    addReplyMultiBulkLen(c, 3);
                     addReplyBulkCString(c, node->slaves[i]->ip);
                     addReplyLongLong(c, node->slaves[i]->port);
+                    addReplyBulkCBuffer(c, node->slaves[i]->name, CLUSTER_NAMELEN);
                     nested_elements++;
                 }
                 setDeferredMultiBulkLength(c, nested_replylen, nested_elements);


Delete existing dialog

Delete existing dialog

SVN revision: 16968

--- src/modules/randr/e_mod_main.c
+++ src/modules/randr/e_mod_main.c
@@ -302,6 +302,7 @@

    ecore_x_randr_screen_size_set(res->manager->root, res->next);

+   if (e->dialog) e_object_del(E_OBJECT(e->dialog));
    e->dialog = e_dialog_new(m->zone->container);
    e_dialog_title_set(e->dialog, "Resolution change");
    e_dialog_text_set(e->dialog, "Keep new resolution?");


squashed the extra trailing colon

squashed the extra trailing colon

--- cpp/portalJson.c
+++ cpp/portalJson.c
@@ -28,24 +28,24 @@
 {
     ConnectalParamJsonInfo *iparam = info->param;
     char *data = (char *)pint->map_base;
-    data += sprintf(data, "{\"name\":\"%s\",", info->name);
+    data += sprintf(data, "{\"name\":\"%s\"", info->name);
     while(iparam->name) {
         uint32_t tmp32;
         uint64_t tmp64;
         int      tmpint;
-        data += sprintf(data, "\"%s\":", iparam->name);
+        data += sprintf(data, ",\"%s\":", iparam->name);
         switch(iparam->itype) {
         case ITYPE_uint32_t:
             tmp32 = *(uint32_t *)((unsigned long)tempdata + iparam->offset);
-            data += sprintf(data, "0x%x,", tmp32);
+            data += sprintf(data, "0x%x", tmp32);
             break;
         case ITYPE_uint64_t:
             tmp64 = *(uint64_t *)((unsigned long)tempdata + iparam->offset);
-            data += sprintf(data, "0x%lx,", (unsigned long)tmp64);
+            data += sprintf(data, "0x%lx", (unsigned long)tmp64);
             break;
         case ITYPE_SpecialTypeForSendingFd:
             tmpint = *(int *)((unsigned long)tempdata + iparam->offset);
-            data += sprintf(data, "%d,", tmpint);
+            data += sprintf(data, "%d", tmpint);
             break;
         default:
             printf("%x type %d\n", *(uint32_t *)((unsigned long)tempdata + iparam->offset), iparam->itype);


Fixed broken return check.

Fixed broken return check.

--- client/X11/xf_graphics.c
+++ client/X11/xf_graphics.c
@@ -195,12 +195,12 @@
 		return FALSE;
 	}

-	if (freerdp_image_copy_from_pointer_data(
+	if (!freerdp_image_copy_from_pointer_data(
 	        (BYTE*) ci.pixels, CursorFormat,
 	        0, 0, 0, pointer->width, pointer->height,
 	        pointer->xorMaskData, pointer->lengthXorMask,
 	        pointer->andMaskData, pointer->lengthAndMask,
-	        pointer->xorBpp, &context->gdi->palette) < 0)
+	        pointer->xorBpp, &context->gdi->palette))
 	{
 		_aligned_free(ci.pixels);
 		xf_unlock_x11(xfc, FALSE);


iwlegacy: return -EINVAL instead of -1

iwlegacy: return -EINVAL instead of -1

Cleanup the code to return -EINVAL instead of -1
Signed-off-by: Greg Dietsche <fab22ba70c1d97aa0b34ba823fba551a1691c0ec@cuw.edu>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/iwlegacy/iwl-4965.c
+++ drivers/net/wireless/iwlegacy/iwl-4965.c
@@ -496,7 +496,7 @@
 	    channel <= CALIB_IWL_TX_ATTEN_GR4_LCH)
 		return CALIB_CH_GROUP_4;

-	return -1;
+	return -EINVAL;
 }

 static u32 iwl4965_get_sub_band(const struct iwl_priv *priv, u32 channel)


Check for NULL

Check for NULL

--- src/libbluray/disc/disc.c
+++ src/libbluray/disc/disc.c
@@ -688,7 +688,7 @@

 void disc_event(BD_DISC *disc, uint32_t event, uint32_t param)
 {
-    if (disc->dec) {
+    if (disc && disc->dec) {
         switch (event) {
             case DISC_EVENT_START:
                 dec_start(disc->dec, param);


Cluster: atomic update of nodes.conf file.

The way the file was generated was unsafe and leaded to nodes.conf file
corruption (zero length file) on server stop/crash during the creation
of the file.

The previous file update method was as simple as open with O_TRUNC
followed by the write call. While the write call was a single one with
the full payload, ensuring no half-written files for POSIX semantics,
stopping the server just after the open call resulted into a zero-length
file (all the nodes information lost!).

--- src/cluster.c
+++ src/cluster.c
@@ -38,6 +38,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/socket.h>
+#include <sys/stat.h>

 clusterNode *createClusterNode(char *nodename, int flags);
 int clusterAddNode(clusterNode *node);
@@ -226,20 +227,45 @@
 /* Cluster node configuration is exactly the same as CLUSTER NODES output.
  *
  * This function writes the node config and returns 0, on error -1
- * is returned. */
+ * is returned.
+ *
+ * Note: we need to write the file in an atomic way from the point of view
+ * of the POSIX filesystem semantics, so that if the server is stopped
+ * or crashes during the write, we'll end with either the old file or the
+ * new one. Since we have the full payload to write available we can use
+ * a single write to write the whole file. If the pre-existing file was
+ * bigger we pad our payload with newlines that are anyway ignored and truncate
+ * the file afterward. */
 int clusterSaveConfig(int do_fsync) {
     sds ci = clusterGenNodesDescription(REDIS_NODE_HANDSHAKE);
+    size_t content_size = sdslen(ci);
+    struct stat sb;
     int fd;

-    if ((fd = open(server.cluster_configfile,O_WRONLY|O_CREAT|O_TRUNC,0644))
+    if ((fd = open(server.cluster_configfile,O_WRONLY|O_CREAT,0644))
         == -1) goto err;
+
+    /* Pad the new payload if the existing file length is greater. */
+    if (fstat(fd,&sb) != -1) {
+        if (sb.st_size > content_size) {
+            ci = sdsgrowzero(ci,sb.st_size);
+            memset(ci+content_size,'\n',sb.st_size-content_size);
+        }
+    }
     if (write(fd,ci,sdslen(ci)) != (ssize_t)sdslen(ci)) goto err;
     if (do_fsync) fsync(fd);
+
+    /* Truncate the file if needed to remove the final \n padding that
+     * is just garbage. */
+    if (content_size != sdslen(ci) && ftruncate(fd,content_size) == -1) {
+        /* ftruncate() failing is not a critical error. */
+    }
     close(fd);
     sdsfree(ci);
     return 0;

 err:
+    if (fd != -1) close(fd);
     sdsfree(ci);
     return -1;
 }


kmssdpcontext: create media copy when it is added to msg

Change-Id: I094e764089fca2b9f317f5a6dbbd2490b02f4667

--- src/gst-plugins/commons/sdpagent/kmssdpcontext.c
+++ src/gst-plugins/commons/sdpagent/kmssdpcontext.c
@@ -363,6 +363,8 @@
 static void
 add_media_to_sdp_message (SdpMediaConfig * mconf, GstSDPMessage * msg)
 {
+  GstSDPMedia *cpy;
+
   if (gst_sdp_message_get_attribute_val (msg, "group") != NULL &&
       gst_sdp_media_get_attribute_val (mconf->media, "mid") == NULL) {
     /* When group attribute is present, the mid attribute */
@@ -370,7 +372,14 @@
     gst_sdp_media_add_attribute (mconf->media, "mid", mconf->mid);
   }

-  gst_sdp_message_add_media (msg, mconf->media);
+  gst_sdp_media_new (&cpy);
+  if (gst_sdp_media_copy (mconf->media, &cpy) != GST_SDP_OK) {
+    gst_sdp_media_free (cpy);
+    GST_ERROR ("Cannot create media copy");
+    return;
+  }
+
+  gst_sdp_message_add_media (msg, cpy);
 }

 static void


MFC: SVN rev 181089

MFC: SVN rev 181089

Increase maximum input queue size limit for raw Bluetooth HCI sockets.

--- sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
+++ sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
@@ -107,7 +107,6 @@
 };

 /* Globals */
-extern int					ifqmaxlen;
 static u_int32_t				ng_btsocket_hci_raw_debug_level;
 static u_int32_t				ng_btsocket_hci_raw_ioctl_timeout;
 static node_p					ng_btsocket_hci_raw_node;
@@ -760,7 +759,7 @@
 	}

 	/* Create input queue */
-	NG_BT_ITEMQ_INIT(&ng_btsocket_hci_raw_queue, ifqmaxlen);
+	NG_BT_ITEMQ_INIT(&ng_btsocket_hci_raw_queue, 300);
 	mtx_init(&ng_btsocket_hci_raw_queue_mtx,
 		"btsocks_hci_raw_queue_mtx", NULL, MTX_DEF);
 	TASK_INIT(&ng_btsocket_hci_raw_task, 0,


samd21/cpu DFLL lock loop error

samd21/cpu DFLL lock loop error

--- cpu/samd21/cpu.c
+++ cpu/samd21/cpu.c
@@ -161,11 +161,10 @@
     }

     SYSCTRL->DFLLCTRL.bit.ENABLE = 1;
-    while ((SYSCTRL->PCLKSR.reg & (SYSCTRL_PCLKSR_DFLLRDY |
-                                   SYSCTRL_PCLKSR_DFLLLCKF |
-                                   SYSCTRL_PCLKSR_DFLLLCKC)) == 0) {
-        /* Wait for DFLLLXXX sync */
-    }
+    uint32_t mask = SYSCTRL_PCLKSR_DFLLRDY |
+                    SYSCTRL_PCLKSR_DFLLLCKF |
+                    SYSCTRL_PCLKSR_DFLLLCKC;
+    while ((SYSCTRL->PCLKSR.reg & mask) != mask) { } /* Wait for DFLL lock */

     /* select the DFLL as source for clock generator 0 (CPU core clock) */
     GCLK->GENDIV.reg =  (GCLK_GENDIV_DIV(1U) | GCLK_GENDIV_ID(0));


Mala zmiana kolejnosci definicji metod

Mala zmiana kolejnosci definicji metod

--- aghContainer.h
+++ aghContainer.h
@@ -203,6 +203,14 @@
 // --------------------------------------------------------------------------------

 template <typename T>
+aghContainer<T>& aghContainer<T>::operator=(const aghContainer<T>& right){
+    this->copy(right);
+    return *this;
+}
+
+// --------------------------------------------------------------------------------
+
+template <typename T>
 bool aghContainer<T>::operator==(const aghContainer<T>& right) const {
     return this->equal(right);
 }
@@ -261,11 +269,4 @@
     return out;
 }

-template <typename T>
-aghContainer<T>& aghContainer<T>::operator=(const aghContainer<T>& right){
-    this->copy(right);
-    return *this;
-}
-
-
 #endif //DATA_CONTAINER_AGHCONTAINER_H


bundles oughta work now

bundles oughta work now

--- src/modules/templates/bundle.c
+++ src/modules/templates/bundle.c
@@ -104,19 +104,15 @@
  if (module_bundle_firstrun) {
   module_bundle_firstrun = 0;

-  fprintf (stderr, "updating bundle modules\n");
-
   if (module_bundle_contents) {
    uint32_t cp = 0;

    for (; module_bundle_contents[cp]; cp++) {
-    fprintf (stderr, "updating bundle module #%i\n", cp);
+    struct lmodule *lmm = mod_add(NULL, (*module_bundle_contents[cp]));

-    struct lmodule *lmm;
-
-    lmm = mod_add(NULL, (*module_bundle_contents[cp]));
-
-    lmm->source = (char *)str_stabilise(module_bundle_rid);
+    if (lmm) {
+     lmm->source = (char *)str_stabilise(module_bundle_rid);
+    }
    }
   }
  }


iwlwifi: mvm: fix the dump_umac_error_log

1. the base_address limitation was wrong, address can be bigger than
0x80C000
2. the ucode data_struct changed.

Signed-off-by: Eran Harary <3ff4dee1187f5ed4a7674b5c6260fcc954c70cf4@intel.com>
Reviewed-by: Liad Kaufman <30d0a3ea07b25a90f61a738417c75a14d6abc5ff@intel.com>
Signed-off-by: Emmanuel Grumbach <643a80aaf16a8332d6a70921c14d4bb265446494@intel.com>

--- drivers/net/wireless/iwlwifi/mvm/utils.c
+++ drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -387,15 +387,19 @@
 struct iwl_umac_error_event_table {
 	u32 valid;		/* (nonzero) valid, (0) log is empty */
 	u32 error_id;		/* type of error */
-	u32 pc;			/* program counter */
 	u32 blink1;		/* branch link */
 	u32 blink2;		/* branch link */
 	u32 ilink1;		/* interrupt link */
 	u32 ilink2;		/* interrupt link */
 	u32 data1;		/* error-specific data */
 	u32 data2;		/* error-specific data */
-	u32 line;		/* source code line of error */
-	u32 umac_ver;		/* umac version */
+	u32 data3;		/* error-specific data */
+	u32 umac_fw_ver;	/* UMAC version */
+	u32 umac_fw_api_ver;	/* UMAC FW API ver */
+	u32 frame_pointer;	/* core register 27*/
+	u32 stack_pointer;	/* core register 28 */
+	u32 cmd_header;	/* latest host cmd sent to UMAC */
+	u32 nic_isr_pref;	/* ISR status register */
 } __packed;

 #define ERROR_START_OFFSET  (1 * sizeof(u32))
@@ -409,7 +413,7 @@

 	base = mvm->umac_error_event_table;

-	if (base < 0x800000 || base >= 0x80C000) {
+	if (base < 0x800000) {
 		IWL_ERR(mvm,
 			"Not valid error log pointer 0x%08X for %s uCode\n",
 			base,
@@ -428,14 +432,19 @@

 	IWL_ERR(mvm, "0x%08X | %-28s\n", table.error_id,
 		desc_lookup(table.error_id));
-	IWL_ERR(mvm, "0x%08X | umac uPc\n", table.pc);
 	IWL_ERR(mvm, "0x%08X | umac branchlink1\n", table.blink1);
 	IWL_ERR(mvm, "0x%08X | umac branchlink2\n", table.blink2);
 	IWL_ERR(mvm, "0x%08X | umac interruptlink1\n", table.ilink1);
 	IWL_ERR(mvm, "0x%08X | umac interruptlink2\n", table.ilink2);
 	IWL_ERR(mvm, "0x%08X | umac data1\n", table.data1);
 	IWL_ERR(mvm, "0x%08X | umac data2\n", table.data2);
-	IWL_ERR(mvm, "0x%08X | umac version\n", table.umac_ver);
+	IWL_ERR(mvm, "0x%08X | umac data3\n", table.data3);
+	IWL_ERR(mvm, "0x%08X | umac version\n", table.umac_fw_ver);
+	IWL_ERR(mvm, "0x%08X | umac api version\n", table.umac_fw_api_ver);
+	IWL_ERR(mvm, "0x%08X | frame pointer\n", table.frame_pointer);
+	IWL_ERR(mvm, "0x%08X | stack pointer\n", table.stack_pointer);
+	IWL_ERR(mvm, "0x%08X | last host cmd\n", table.cmd_header);
+	IWL_ERR(mvm, "0x%08X | isr status reg\n", table.nic_isr_pref);
 }

 void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)


Increased the nolp buffer size to avoid a bug

This is a temporary fix to avoid a bug that would occur when data was sent too fast. nolp will eventually be rewritten
or replaced before release.

--- src/libmethaconfig/nolp.h
+++ src/libmethaconfig/nolp.h
@@ -22,7 +22,7 @@
 #ifndef _NOLP__H_
 #define _NOLP__H_

-#define NOLP_DEFAULT_BUFSZ 256
+#define NOLP_DEFAULT_BUFSZ 512

 enum {
     NOLP_CMD,


coap_io.c: Include multicast addresses in is_local_if()

is_local_if() checks if a message's destination address matches
a local interface. As multicast requests are allowed on either
interface, this function now returns true when the destination
address is a multicast address.

--- src/coap_io.c
+++ src/coap_io.c
@@ -396,7 +396,8 @@
  */
 static inline int
 is_local_if(const coap_address_t *local, const coap_address_t *dst) {
-  return coap_address_isany(local) || coap_address_equals(dst, local);
+  return coap_address_isany(local) || coap_address_equals(dst, local) ||
+    coap_is_mcast(dst);
 }

 ssize_t


rt2x00: Don't switch off LED on initialization

When we switch off the LEDS during initialization
we kill rt73usb from proper functioning. The immediate
result after the first LED command are MCU failures
and a complete breakdown of TX/RX.

Signed-off-by: Ivo van Doorn <eb95d5f7a69eb0f8d26a960fe33483acdf581277@gmail.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/rt2x00/rt2x00leds.c
+++ drivers/net/wireless/rt2x00/rt2x00leds.c
@@ -111,12 +111,6 @@
 	led->led_dev.name = name;
 	led->led_dev.brightness = LED_OFF;

-	/*
-	 * Ensure the LED is off, it might have been enabled
-	 * by the hardware when the device was powered on.
-	 */
-	led->led_dev.brightness_set(&led->led_dev, LED_OFF);
-
 	retval = led_classdev_register(device, &led->led_dev);
 	if (retval) {
 		ERROR(rt2x00dev, "Failed to register led handler.\n");


a typearg that is the typeparam always satisfies its own constraint

--- src/libponyc/type/reify.c
+++ src/libponyc/type/reify.c
@@ -182,6 +182,18 @@

   while(typeparam != NULL)
   {
+    if(ast_id(typearg) == TK_TYPEPARAMREF)
+    {
+      ast_t* def = (ast_t*)ast_data(typearg);
+
+      if(def == typeparam)
+      {
+        typeparam = ast_sibling(typeparam);
+        typearg = ast_sibling(typearg);
+        continue;
+      }
+    }
+
     // Reify the constraint.
     ast_t* constraint = ast_childidx(typeparam, 1);
     ast_t* bind_constraint = bind_type(constraint);


Staging: comedi: Remove das1800_private typedef

Signed-off-by: Bill Pemberton <6208e3c588e4690c7dfac5e95777d6a902c5fb27@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/comedi/drivers/das1800.c
+++ drivers/staging/comedi/drivers/das1800.c
@@ -463,7 +463,7 @@
  */
 #define thisboard ((const struct das1800_board *)dev->board_ptr)

-typedef struct {
+struct das1800_private {
 	volatile unsigned int count;	/* number of data points left to be taken */
 	unsigned int divisor1;	/* value to load into board's counter 1 for timed conversions */
 	unsigned int divisor2;	/* value to load into board's counter 2 for timed conversions */
@@ -481,9 +481,9 @@
 	unsigned int dma_transfer_size;	/* size of transfer currently used, in bytes */
 	unsigned long iobase2;	/* secondary io address used for analog out on 'ao' boards */
 	short ao_update_bits;	/* remembers the last write to the 'update' dac */
-} das1800_private;
-
-#define devpriv ((das1800_private *)dev->private)
+};
+
+#define devpriv ((struct das1800_private *)dev->private)

 // analog out range for boards with basic analog out
 static const struct comedi_lrange range_ao_1 = {
@@ -602,7 +602,7 @@
 	int retval;

 	/* allocate and initialize dev->private */
-	if (alloc_private(dev, sizeof(das1800_private)) < 0)
+	if (alloc_private(dev, sizeof(struct das1800_private)) < 0)
 		return -ENOMEM;

 	printk("comedi%d: %s: io 0x%lx", dev->minor, driver_das1800.driver_name,


staging: comedi: dmm32at: make AI (*cancel) actually cancel async command

Currently the AI (*cancel) changes a private data member to cause the
interrupt handler to cancel the async command after the next interrupt.

Move the code that disables the interrupt and terminates the acquisition
from the interrunt handler into dmm32at_ai_cancel() so that the async
command is terminated instantly.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Reviewed-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/dmm32at.c
+++ drivers/staging/comedi/drivers/dmm32at.c
@@ -468,9 +468,8 @@
 static int dmm32at_ai_cancel(struct comedi_device *dev,
 			     struct comedi_subdevice *s)
 {
-	struct dmm32at_private *devpriv = dev->private;
-
-	devpriv->ai_scans_left = 1;
+	/* disable further interrupts and clocks */
+	outb(0x0, dev->iobase + DMM32AT_INTCLOCK);
 	return 0;
 }

@@ -507,8 +506,6 @@
 		if (devpriv->ai_scans_left != 0xffffffff) {	/* TRIG_COUNT */
 			devpriv->ai_scans_left--;
 			if (devpriv->ai_scans_left == 0) {
-				/* disable further interrupts and clocks */
-				outb(0x0, dev->iobase + DMM32AT_INTCLOCK);
 				/* set the buffer to be flushed with an EOF */
 				s->async->events |= COMEDI_CB_EOA;
 			}


Fix typo: declaraton → declaration

Fix typo: declaraton → declaration

--- lib/Sema/OverloadChoice.h
+++ lib/Sema/OverloadChoice.h
@@ -208,7 +208,7 @@
     }
   }

-  /// \brief Retrieve the declaraton that corresponds to this overload choice.
+  /// \brief Retrieve the declaration that corresponds to this overload choice.
   ValueDecl *getDecl() const {
     assert(isDecl() && "Not a declaration");
     return reinterpret_cast<ValueDecl *>(DeclOrKind & ~(uintptr_t)0x03);


staging: ipack: tpci200: fixes 80 character line length issue

This fixes one of the two instances of an 80+ char line in the file.
Fixing the other instance would have decreased the readability of the
code, in my opinion.

Signed-off-by: Johan Meiring <a6b7713e5392f8f211aced979ec0f944249ef621@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/ipack/carriers/tpci200.c
+++ drivers/staging/ipack/carriers/tpci200.c
@@ -209,7 +209,8 @@

 	if (tpci200->slots[dev->slot].irq != NULL) {
 		dev_err(&dev->dev,
-			"Slot [%d:%d] IRQ already registered !\n", dev->bus->bus_nr,
+			"Slot [%d:%d] IRQ already registered !\n",
+			dev->bus->bus_nr,
 			dev->slot);
 		res = -EINVAL;
 		goto out_unlock;


Staging: rtl8188eu: Fix warning of unnecessary parentheses.

This patch fixes the warning of "unnecessary parentheses" in file rtw_cmd.c.

Signed-off-by: Elena Oat <422762b486b261e4ccdd4771c9579ad80ea4b399@gmail.com>
Acked-by: Paul E. McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -2133,7 +2133,7 @@
 	struct wlan_network *tgt_network = &(pmlmepriv->cur_network);

-	if ((pcmd->res != H2C_SUCCESS)) {
+	if (pcmd->res != H2C_SUCCESS) {
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: rtw_createbss_cmd_callback  Fail ************\n\n."));
 		_set_timer(&pmlmepriv->assoc_timer, 1);
 	}


Staging: winbond: Fix for brace style, length and whitespace in mac_structures.h

This patch fixes line length, brace style and whitespace issues in the
mac_structures.h file found by the checkpatch.pl tool

Signed-off-by: Adam Latham <c32cd6afa48392969176be60e3c0fe94f8c2cc8e@unisontorbay.org.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/winbond/mac_structures.h
+++ drivers/staging/winbond/mac_structures.h
@@ -41,8 +41,10 @@
 #define DOT_11_MAC_HEADER_SIZE		24
 #define DOT_11_SNAP_SIZE			6
 #define DOT_11_DURATION_OFFSET		2
-#define DOT_11_SEQUENCE_OFFSET		22 /* Sequence control offset */
-#define DOT_11_TYPE_OFFSET			30 /* The start offset of 802.11 Frame// */
+/* Sequence control offset */
+#define DOT_11_SEQUENCE_OFFSET		22
+/* The start offset of 802.11 Frame// */
+#define DOT_11_TYPE_OFFSET			30
 #define DOT_11_DATA_OFFSET          24
 #define DOT_11_DA_OFFSET			4
 #define DOT_3_TYPE_ARP				0x80F3
@@ -385,9 +387,11 @@
 #ifdef _WPA2_
 #define VERSION_WPA2            1
 #endif /* end def  _WPA2_ */
-#define OUI_WPA					0x00F25000	/* WPA2.0 OUI=00:50:F2, the MSB is reserved for suite type */
+/* WPA2.0 OUI=00:50:F2, the MSB is reserved for suite type */
+#define OUI_WPA					0x00F25000
 #ifdef _WPA2_
-#define OUI_WPA2				0x00AC0F00	/* for wpa2 change to 0x00ACOF04 by Ws 26/04/04 */
+/* for wpa2 change to 0x00ACOF04 by Ws 26/04/04 */
+#define OUI_WPA2				0x00AC0F00
 #endif /* end def _WPA2_ */

 #define OUI_WPA_ADDITIONAL		0x01
@@ -400,8 +404,8 @@

 #define WPA_OUI_BIG    ((u32) 0x01F25000)/* added by ws 09/23/04 */
 #define WPA_OUI_LITTLE  ((u32) 0x01F25001)/* added by ws 09/23/04 */
-
-#define WPA_WPS_OUI				cpu_to_le32(0x04F25000) /* 20061108 For WPS. It's little endian. Big endian is 0x0050F204 */
+/* 20061108 For WPS. It's little endian. Big endian is 0x0050F204 */
+#define WPA_WPS_OUI				cpu_to_le32(0x04F25000)

 /* -----WPA2----- */
 #ifdef _WPA2_
@@ -420,75 +424,65 @@
 #define OUI_CIPHER_CCMP				0x04
 #define OUI_CIPHER_WEP_104			0x05

-struct suite_selector
-{
-	union
-	{
+struct suite_selector{
+	union{
 		u8	Value[4];
-		struct _SUIT_
-		{
+		struct _SUIT_ {
 			u8	OUI[3];
 			u8	Type;
-		}SuitSelector;
+		} SuitSelector;
 	};
 };

 /* --  WPA  -- */
-struct	RSN_Information_Element
-{
+struct	RSN_Information_Element{
 	u8					Element_ID;
 	u8					Length;
-	struct suite_selector	OuiWPAAdditional; /* WPA version 2.0 additional field, and should be 00:50:F2:01 */
+ /* WPA version 2.0 additional field, and should be 00:50:F2:01 */
+	struct suite_selector	OuiWPAAdditional;
 	u16					Version;
 	struct suite_selector		GroupKeySuite;
 	u16					PairwiseKeySuiteCount;
 	struct suite_selector		PairwiseKeySuite[1];
-}__attribute__ ((packed));
-struct RSN_Auth_Sub_Information_Element
-{
+} __attribute__ ((packed));
+struct RSN_Auth_Sub_Information_Element {
 	u16				AuthKeyMngtSuiteCount;
 	struct suite_selector	AuthKeyMngtSuite[1];
-}__attribute__ ((packed));
+} __attribute__ ((packed));

 /* --  WPA2  -- */
-struct RSN_Capability_Element
-{
-  union
-  {
+struct RSN_Capability_Element {
+  union {
 	u16	__attribute__ ((packed))	wValue;
     #ifdef _BIG_ENDIAN_	 /* 20060927 add by anson's endian */
-    struct _RSN_Capability
-    {
-    	u16   __attribute__ ((packed))  Reserved2 : 8; /* 20051201 */
-	u16   __attribute__ ((packed))  Reserved1 : 2;
-	u16   __attribute__ ((packed))  GTK_Replay_Counter : 2;
-	u16   __attribute__ ((packed))  PTK_Replay_Counter : 2;
-	u16   __attribute__ ((packed))  No_Pairwise : 1;
-        u16   __attribute__ ((packed))  Pre_Auth : 1;
-    }__attribute__ ((packed))  RSN_Capability;
+    struct _RSN_Capability {
+	u16   __attribute__ ((packed))  Reserved2:8; /* 20051201 */
+	u16   __attribute__ ((packed))  Reserved1:2;
+	u16   __attribute__ ((packed))  GTK_Replay_Counter:2;
+	u16   __attribute__ ((packed))  PTK_Replay_Counter:2;
+	u16   __attribute__ ((packed))  No_Pairwise:1;
+	u16   __attribute__ ((packed))  Pre_Auth:1;
+    } __attribute__ ((packed))  RSN_Capability;
     #else
-    struct _RSN_Capability
-    {
-        u16   __attribute__ ((packed))  Pre_Auth : 1;
-        u16   __attribute__ ((packed))  No_Pairwise : 1;
-        u16   __attribute__ ((packed))  PTK_Replay_Counter : 2;
-	    u16   __attribute__ ((packed))  GTK_Replay_Counter : 2;
-	    u16   __attribute__ ((packed))  Reserved1 : 2;
-	    u16   __attribute__ ((packed))  Reserved2 : 8; /* 20051201 */
-    }__attribute__ ((packed))  RSN_Capability;
+    struct _RSN_Capability {
+	u16   __attribute__ ((packed))  Pre_Auth:1;
+	u16   __attribute__ ((packed))  No_Pairwise:1;
+	u16   __attribute__ ((packed))  PTK_Replay_Counter:2;
+	u16   __attribute__ ((packed))  GTK_Replay_Counter:2;
+	u16   __attribute__ ((packed))  Reserved1:2;
+	u16   __attribute__ ((packed))  Reserved2:8; /* 20051201 */
+    } __attribute__ ((packed))  RSN_Capability;
     #endif

-  }__attribute__ ((packed)) ;
-}__attribute__ ((packed)) ;
+  } __attribute__ ((packed)) ;
+} __attribute__ ((packed)) ;

 #ifdef _WPA2_
-struct pmkid
-{
+struct pmkid {
   u8 pValue[16];
 };

-struct	WPA2_RSN_Information_Element
-{
+struct	WPA2_RSN_Information_Element {
 	u8					Element_ID;
 	u8					Length;
 	u16					Version;
@@ -496,29 +490,28 @@
 	u16					PairwiseKeySuiteCount;
 	struct suite_selector		PairwiseKeySuite[1];

-}__attribute__ ((packed));
-
-struct WPA2_RSN_Auth_Sub_Information_Element
-{
+} __attribute__ ((packed));
+
+struct WPA2_RSN_Auth_Sub_Information_Element {
 	u16				AuthKeyMngtSuiteCount;
 	struct suite_selector	AuthKeyMngtSuite[1];
-}__attribute__ ((packed));
-
-
-struct PMKID_Information_Element
-{
+} __attribute__ ((packed));
+
+
+struct PMKID_Information_Element {
 	u16				PMKID_Count;
 	struct pmkid pmkid[16];
-}__attribute__ ((packed));
+} __attribute__ ((packed));

 #endif /* enddef _WPA2_ */
 /*============================================================
 // MAC Frame structure (different type) and subfield structure
 //============================================================*/
-struct MAC_frame_control
-{
-    u8    mac_frame_info; /* a combination of the [Protocol Version, Control Type, Control Subtype]*/
-    #ifdef _BIG_ENDIAN_ /* 20060927 add by anson's endian */
+struct MAC_frame_control {
+/* a combination of the [Protocol Version, Control Type, Control Subtype]*/
+    u8    mac_frame_info;
+/* 20060927 add by anson's endian */
+    #ifdef _BIG_ENDIAN_
     u8    order:1;
     u8    WEP:1;
     u8    more_data:1;
@@ -540,7 +533,8 @@
 } __attribute__ ((packed));

 struct Management_Frame {
-    struct MAC_frame_control frame_control; /* 2B, ToDS,FromDS,MoreFrag,MoreData,Order=0 */
+/* 2B, ToDS,FromDS,MoreFrag,MoreData,Order=0 */
+    struct MAC_frame_control frame_control;
     u16		duration;
     u8		DA[MAC_ADDR_LENGTH];			/* Addr1 */
     u8		SA[MAC_ADDR_LENGTH];			/* Addr2 */
@@ -552,7 +546,8 @@

 /* SW-MAC don't Tx/Rx Control-Frame, HW-MAC do it. */
 struct Control_Frame {
-    struct MAC_frame_control frame_control; /* ToDS,FromDS,MoreFrag,Retry,MoreData,WEP,Order=0 */
+/* ToDS,FromDS,MoreFrag,Retry,MoreData,WEP,Order=0 */
+    struct MAC_frame_control frame_control;
     u16		duration;
     u8		RA[MAC_ADDR_LENGTH];
     u8		TA[MAC_ADDR_LENGTH];
@@ -627,8 +622,9 @@
     u16    algorithmNumber;
     u16    sequenceNumber;
     u16    statusCode;
-    /* NB: don't include ChallengeText in this structure
-	// struct Challenge_Text_Element sChallengeTextElement; // wkchen added */
+	/* NB: don't include ChallengeText in this structure
+	// struct Challenge_Text_Element sChallengeTextElement;
+	// wkchen added */
 } __attribute__ ((packed));


android/gatt: Add client write descriptor handler

This adds writing descriptors. In case of providing invalid descriptor
error status is send with notification.

--- android/gatt.c
+++ android/gatt.c
@@ -2034,12 +2034,130 @@
 			HAL_OP_GATT_CLIENT_READ_DESCRIPTOR, status);
 }

+static void send_client_descr_write_notify(int32_t status, int32_t conn_id,
+						const struct element_id *srvc,
+						const struct element_id *ch,
+						const struct element_id *descr,
+						uint8_t primary) {
+	uint8_t buf[IPC_MTU];
+	struct hal_ev_gatt_client_write_descriptor *ev = (void *) buf;
+
+	memset(buf, 0, sizeof(buf));
+
+	ev->status = status;
+	ev->conn_id = conn_id;
+
+	element_id_to_hal_srvc_id(srvc, primary, &ev->data.srvc_id);
+	element_id_to_hal_gatt_id(ch, &ev->data.char_id);
+	element_id_to_hal_gatt_id(descr, &ev->data.descr_id);
+
+	ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT,
+					HAL_EV_GATT_CLIENT_WRITE_DESCRIPTOR,
+					sizeof(*ev), ev);
+}
+
+static void write_descr_cb(guint8 status, const guint8 *pdu, guint16 len,
+							gpointer user_data)
+{
+	struct desc_data *cb_data = user_data;
+
+	if (status)
+		error("gatt: Write descriptors failed: %s",
+							att_ecode2str(status));
+
+	send_client_descr_write_notify(status, cb_data->conn_id,
+					cb_data->srvc_id, cb_data->char_id,
+					cb_data->descr_id, cb_data->primary);
+
+	free(cb_data);
+}
+
 static void handle_client_write_descriptor(const void *buf, uint16_t len)
 {
-	DBG("");
-
-	ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT,
-			HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR, HAL_STATUS_FAILED);
+	const struct hal_cmd_gatt_client_write_descriptor *cmd = buf;
+	struct desc_data *cb_data;
+	struct characteristic *ch;
+	struct descriptor *descr;
+	struct service *srvc;
+	struct element_id srvc_id;
+	struct element_id char_id;
+	struct element_id descr_id;
+	struct gatt_device *dev;
+	int32_t conn_id;
+	uint8_t primary;
+	uint8_t status;
+
+	DBG("");
+
+	if (len != sizeof(*cmd) + cmd->len) {
+		error("Invalid write desriptor command (%u bytes), terminating",
+									len);
+		raise(SIGTERM);
+		return;
+	}
+
+	primary = cmd->srvc_id.is_primary;
+	conn_id = cmd->conn_id;
+
+	hal_srvc_id_to_element_id(&cmd->srvc_id, &srvc_id);
+	hal_gatt_id_to_element_id(&cmd->char_id, &char_id);
+	hal_gatt_id_to_element_id(&cmd->descr_id, &descr_id);
+
+	if (!find_service(cmd->conn_id, &srvc_id, &dev, &srvc)) {
+		error("gatt: Write descr. could not find service");
+
+		status = HAL_STATUS_FAILED;
+		goto failed;
+	}
+
+	ch = queue_find(srvc->chars, match_char_by_element_id, &char_id);
+	if (!ch) {
+		error("gatt: Write descr. could not find characteristic");
+
+		status = HAL_STATUS_FAILED;
+		goto failed;
+	}
+
+	descr = queue_find(ch->descriptors, match_descr_by_element_id,
+								&descr_id);
+	if (!descr) {
+		error("gatt: Write descr. could not find descriptor");
+
+		status = HAL_STATUS_FAILED;
+		goto failed;
+	}
+
+	cb_data = new0(struct desc_data, 1);
+	if (!cb_data) {
+		error("gatt: Write descr. could not allocate callback data");
+
+		status = HAL_STATUS_NOMEM;
+		goto failed;
+	}
+
+	cb_data->conn_id = conn_id;
+	cb_data->srvc_id = &srvc->id;
+	cb_data->char_id = &ch->id;
+	cb_data->descr_id = &descr->id;
+	cb_data->primary = primary;
+
+	if (!gatt_write_char(dev->attrib, descr->handle, cmd->value, cmd->len,
+						write_descr_cb, cb_data)) {
+		free(cb_data);
+
+		status = HAL_STATUS_FAILED;
+		goto failed;
+	}
+
+	status = HAL_STATUS_SUCCESS;
+
+failed:
+	if (status != HAL_STATUS_SUCCESS)
+		send_client_descr_write_notify(GATT_FAILURE, conn_id, &srvc_id,
+						&char_id, &descr_id, primary);
+
+	ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT,
+				HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR, status);
 }

 static void handle_client_execute_write(const void *buf, uint16_t len)


iscsi-target: Fix up a few assignments

iscsi-target: Fix up a few assignments

A statement such as
  struct iscsi_node_attrib *na = na = iscsit_tpg_get_node_attrib(sess);
has undefined behaviour since there are two assignments to 'na', strictly
speaking (the order in which side-effects from the assignments take place
is undefined since there's no intervening sequence point), and it looks
unintentional in any case.

Signed-off-by: Jesper Juhl <7323a5431d1c31072983a6a5bf23745b655ddf59@chaosbits.net>
Signed-off-by: Nicholas Bellinger <978acd1567d5598152161fdf8bf3ca568f950c9b@linux-iscsi.org>

--- drivers/target/iscsi/iscsi_target_erl1.c
+++ drivers/target/iscsi/iscsi_target_erl1.c
@@ -1238,7 +1238,7 @@
 {
 	struct iscsi_conn *conn = cmd->conn;
 	struct iscsi_session *sess = conn->sess;
-	struct iscsi_node_attrib *na = na = iscsit_tpg_get_node_attrib(sess);
+	struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);

 	spin_lock_bh(&cmd->dataout_timeout_lock);
 	if (!(cmd->dataout_timer_flags & ISCSI_TF_RUNNING)) {
@@ -1261,7 +1261,7 @@
 	struct iscsi_conn *conn)
 {
 	struct iscsi_session *sess = conn->sess;
-	struct iscsi_node_attrib *na = na = iscsit_tpg_get_node_attrib(sess);
+	struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);

 	if (cmd->dataout_timer_flags & ISCSI_TF_RUNNING)
 		return;


android: Add option to specify controller index to use

This will be usefull while testing on Linux where more controllers
can be present.

--- android/main.c
+++ android/main.c
@@ -455,10 +455,13 @@
 }

 static gboolean option_version = FALSE;
+static gint option_index = MGMT_INDEX_NONE;

 static GOptionEntry options[] = {
 	{ "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
 				"Show version information and exit", NULL },
+	{ "index", 'i', 0, G_OPTION_ARG_INT, &option_index,
+				"Use specified controller", "INDEX"},
 	{ NULL }
 };

@@ -481,10 +484,17 @@
 static void mgmt_index_added_event(uint16_t index, uint16_t length,
 					const void *param, void *user_data)
 {
+	uint16_t opt_index = option_index;
+
 	DBG("index %u", index);

 	if (adapter_index != MGMT_INDEX_NONE) {
 		DBG("skip event for index %u", index);
+		return;
+	}
+
+	if (opt_index != MGMT_INDEX_NONE && opt_index != index) {
+		DBG("skip event for index %u (option %u)", index, opt_index);
 		return;
 	}

@@ -521,7 +531,9 @@
 					const void *param, void *user_data)
 {
 	const struct mgmt_rp_read_index_list *rp = param;
+	uint16_t opt_index = option_index;
 	uint16_t num;
+	int i;

 	DBG("");

@@ -548,19 +560,26 @@
 	if (adapter_index != MGMT_INDEX_NONE)
 		return;

-	if (num < 1) {
-		adapter_timeout = g_timeout_add_seconds(STARTUP_GRACE_SECONDS,
-						adapter_timeout_handler, NULL);
-		if (adapter_timeout == 0) {
-			error("%s: Failed init timeout", __func__);
-			goto error;
-		}
-		return;
-	}
-
-	adapter_index = btohs(rp->index[0]);
-	bt_adapter_init(adapter_index, mgmt_if, adapter_ready);
-	return;
+	for (i = 0; i < num; i++) {
+		uint16_t index = btohs(rp->index[i]);
+
+		if (opt_index != MGMT_INDEX_NONE && opt_index != index)
+			continue;
+
+		adapter_index = index;
+		bt_adapter_init(adapter_index, mgmt_if, adapter_ready);
+		return;
+	}
+
+	if (adapter_index != MGMT_INDEX_NONE)
+		return;
+
+	adapter_timeout = g_timeout_add_seconds(STARTUP_GRACE_SECONDS,
+					adapter_timeout_handler, NULL);
+	if (adapter_timeout > 0)
+		return;
+
+	error("%s: Failed init timeout", __func__);

 error:
 	g_main_loop_quit(event_loop);


Fix ANSI colour brightness. (Also forces white on black.)

--- src/engine/sys/sys_main.c
+++ src/engine/sys/sys_main.c
@@ -307,7 +307,7 @@
 			if ( *msg == '\n' )
 			{
 				// Issue a reset and then the newline
-				fputs( "\033[0m\n", stderr );
+				fputs( "\033[0;40;37m\n", stderr );
 				msg++;
 			}
 			else
@@ -315,7 +315,8 @@
 				// Print the color code
 				int colour = colour16map[ index ][ ( msg[ 1 ] - '0' ) & 31 ];

-				Com_sprintf( buffer, sizeof( buffer ), "\033[%d%sm",
+				Com_sprintf( buffer, sizeof( buffer ), "\033[%s%d%sm",
+				             (colour & 0x30) == 0 ? "0;" : "",
 				             30 + ( colour & 15 ), modifier[ ( colour / 16 ) & 3 ] );
 				fputs( buffer, stderr );
 				msg += 2;


removed tracing

removed tracing

--- OOps/str_ops.c
+++ OOps/str_ops.c
@@ -293,7 +293,7 @@
     int     i = 0, j = 0, n;
     const char  *segwaiting = NULL;
     int     maxChars, siz = strlen(fmt) + numVals*7 + 1;
-    printf("%s \n", fmt);
+
     if (UNLIKELY((int) ((OPDS*) p)->optext->t.xincod != 0))
       return StrOp_ErrMsg(p, "a-rate argument not allowed");
     if (UNLIKELY((int) ((OPDS*) p)->optext->t.inArgCount > 31)){


doc: kslookup docu

doc: kslookup docu

see #1152

--- src/libs/elektra/keyset.c
+++ src/libs/elektra/keyset.c
@@ -1907,6 +1907,13 @@
 /**
  * Look for a Key contained in @p ks that matches the name of the @p key.
  *
+ * @note that applications should only use ksLookup() with cascading
+ * keys. Furthermore, a lookup should be done for every key, in particular
+ * during iterations so that the specifications are honored correctly.
+ * Keys of all namespaces need to be present so that ksLookup()
+ * can work correctly, so make sure to also use kdbGet() with a cascading
+ * key.
+ *
  * @p ksLookup() is designed to let you work with
  * entirely pre-loaded KeySets. The
  * idea is to fully kdbGet() for your application root key and


Remove BQEs once they are activated

Remove BQEs once they are activated

(Duh.)

--- src/command.c
+++ src/command.c
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
+#include <string.h>  // WHY OH WHY is memmove defined in here
 #include "command.h"

 #define min(a,b) ((a) < (b) ? (a) : (b))
@@ -82,7 +83,11 @@
                     if (bqes[i].plane == plane->name && bqes[i].which == bIdx) {
                         // yay! we have an event!
                         (*bqes[i].func)(data, bqes[i].plane, bqes[i].extra);
-                        // TODO remove from bqes
+                        // remove bqe
+                        memmove(bqes + i, bqes + i + 1,
+                                sizeof(BeaconQueueEvent) * (--nBqes - i));
+                        bqes = realloc(bqes, nBqes * sizeof(BeaconQueueEvent));
+                        --i;
                     }
                 }
                 break;  // plane can't be on multiple beacons


Remove workaround for g_struct_info_get_size reporting incorrect size

Remove workaround for g_struct_info_get_size reporting incorrect size
for boxed GValues. Verified this now returns the correct size of 24.

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

--- gi/pygi-boxed.c
+++ gi/pygi-boxed.c
@@ -53,24 +53,19 @@
 {
     gsize size;

-    /* FIXME: Remove when bgo#622711 is fixed */
-    if (g_registered_type_info_get_g_type (info) == G_TYPE_VALUE) {
-        size = sizeof (GValue);
-    } else {
-        switch (g_base_info_get_type (info)) {
-            case GI_INFO_TYPE_UNION:
-                size = g_union_info_get_size ( (GIUnionInfo *) info);
-                break;
-            case GI_INFO_TYPE_BOXED:
-            case GI_INFO_TYPE_STRUCT:
-                size = g_struct_info_get_size ( (GIStructInfo *) info);
-                break;
-            default:
-                PyErr_Format (PyExc_TypeError,
-                              "info should be Boxed or Union, not '%d'",
-                              g_base_info_get_type (info));
-                return NULL;
-        }
+    switch (g_base_info_get_type (info)) {
+        case GI_INFO_TYPE_UNION:
+            size = g_union_info_get_size ( (GIUnionInfo *) info);
+            break;
+        case GI_INFO_TYPE_BOXED:
+        case GI_INFO_TYPE_STRUCT:
+            size = g_struct_info_get_size ( (GIStructInfo *) info);
+            break;
+        default:
+            PyErr_Format (PyExc_TypeError,
+                          "info should be Boxed or Union, not '%d'",
+                          g_base_info_get_type (info));
+            return NULL;
     }

     if( size_out != NULL)


giostream: Fix a typo in the documentation for g_io_stream_close()

--- gio/giostream.c
+++ gio/giostream.c
@@ -337,7 +337,7 @@
  * @error: location to store the error occurring, or %NULL to ignore
  *
  * Closes the stream, releasing resources related to it. This will also
- * closes the individual input and output streams, if they are not already
+ * close the individual input and output streams, if they are not already
  * closed.
  *
  * Once the stream is closed, all other operations will return


remove mention of samplei, samplej, samplek, samplel

git-svn-id: 0ef30dc7da0b07cedfa074587325a6c153c0ae55@7185 fdbf22ae-c210-0410-be80-ca943da6b8f8

--- fer/ccr/EF_InternalUtil.c
+++ fer/ccr/EF_InternalUtil.c
@@ -202,23 +202,6 @@
 void FORTRAN(fftp_compute)(int *, float *, float *, float *,
                            float *, float *, float *);

-void FORTRAN(samplei_init)(int *);
-void FORTRAN(samplei_result_limits)(int *);
-void FORTRAN(samplei_compute)(int *, float *, float, float *);
-
-void FORTRAN(samplej_init)(int *);
-void FORTRAN(samplej_result_limits)(int *);
-void FORTRAN(samplej_compute)(int *, float *, float, float *);
-
-void FORTRAN(samplek_init)(int *);
-void FORTRAN(samplek_result_limits)(int *);
-void FORTRAN(samplek_compute)(int *, float *, float, float *);
-
-void FORTRAN(samplel_init)(int *);
-void FORTRAN(samplel_result_limits)(int *);
-void FORTRAN(samplel_compute)(int *, float *, float, float *);
-
-
 void FORTRAN(sampleij_init)(int *);
 void FORTRAN(sampleij_result_limits)(int *);
 void FORTRAN(sampleij_work_size)(int *);
@@ -352,7 +335,7 @@
  *  int_dlsym.pl.  Check that N_INTEF is correctly defined below.
  */

-#define N_INTEF 21
+#define N_INTEF 17

 struct {
   char funcname[EF_MAX_NAME_LENGTH];
@@ -360,25 +343,21 @@

    strcpy(I_EFnames[0].funcname, "ffta");
    strcpy(I_EFnames[1].funcname, "fftp");
-   strcpy(I_EFnames[2].funcname, "samplei");
-   strcpy(I_EFnames[3].funcname, "sampleij");
-   strcpy(I_EFnames[4].funcname, "samplej");
-   strcpy(I_EFnames[5].funcname, "samplek");
-   strcpy(I_EFnames[6].funcname, "samplel");
-   strcpy(I_EFnames[7].funcname, "samplet_date");
-   strcpy(I_EFnames[8].funcname, "samplexy");
-   strcpy(I_EFnames[9].funcname, "scat2gridgauss_xy");
-   strcpy(I_EFnames[10].funcname, "scat2gridgauss_xz");
-   strcpy(I_EFnames[11].funcname, "scat2gridgauss_yz");
-   strcpy(I_EFnames[12].funcname, "scat2gridlaplace_xy");
-   strcpy(I_EFnames[13].funcname, "scat2gridlaplace_xz");
-   strcpy(I_EFnames[14].funcname, "scat2gridlaplace_yz");
-   strcpy(I_EFnames[15].funcname, "sorti");
-   strcpy(I_EFnames[16].funcname, "sortj");
-   strcpy(I_EFnames[17].funcname, "sortk");
-   strcpy(I_EFnames[18].funcname, "sortl");
-   strcpy(I_EFnames[19].funcname, "tauto_cor");
-   strcpy(I_EFnames[20].funcname, "xauto_cor");
+   strcpy(I_EFnames[2].funcname, "sampleij");
+   strcpy(I_EFnames[3].funcname, "samplet_date");
+   strcpy(I_EFnames[4].funcname, "samplexy");
+   strcpy(I_EFnames[5].funcname, "scat2gridgauss_xy");
+   strcpy(I_EFnames[6].funcname, "scat2gridgauss_xz");
+   strcpy(I_EFnames[7].funcname, "scat2gridgauss_yz");
+   strcpy(I_EFnames[8].funcname, "scat2gridlaplace_xy");
+   strcpy(I_EFnames[9].funcname, "scat2gridlaplace_xz");
+   strcpy(I_EFnames[10].funcname, "scat2gridlaplace_yz");
+   strcpy(I_EFnames[11].funcname, "sorti");
+   strcpy(I_EFnames[12].funcname, "sortj");
+   strcpy(I_EFnames[13].funcname, "sortk");
+   strcpy(I_EFnames[14].funcname, "sortl");
+   strcpy(I_EFnames[15].funcname, "tauto_cor");
+   strcpy(I_EFnames[16].funcname, "xauto_cor");

 /*
  *  ------------------------------------
@@ -2084,27 +2063,6 @@
 else if ( !strcmp(name,"fftp_work_size_") ) return (void *)FORTRAN(fftp_work_size);
 else if ( !strcmp(name,"fftp_compute_") ) return (void *)FORTRAN(fftp_compute);

-
-/* samplei.F */
-else if ( !strcmp(name,"samplei_init_") ) return (void *)FORTRAN(samplei_init);
-else if ( !strcmp(name,"samplei_result_limits_") ) return (void *)FORTRAN(samplei_result_limits);
-else if ( !strcmp(name,"samplei_compute_") ) return (void *)FORTRAN(samplei_compute);
-
-/* samplej.F */
-else if ( !strcmp(name,"samplej_init_") ) return (void *)FORTRAN(samplej_init);
-else if ( !strcmp(name,"samplej_result_limits_") ) return (void *)FORTRAN(samplej_result_limits);
-else if ( !strcmp(name,"samplej_compute_") ) return (void *)FORTRAN(samplej_compute);
-
-/* samplek.F */
-else if ( !strcmp(name,"samplek_init_") ) return (void *)FORTRAN(samplek_init);
-else if ( !strcmp(name,"samplek_result_limits_") ) return (void *)FORTRAN(samplek_result_limits);
-else if ( !strcmp(name,"samplek_compute_") ) return (void *)FORTRAN(samplek_compute);
-
-/* samplel.F */
-else if ( !strcmp(name,"samplel_init_") ) return (void *)FORTRAN(samplel_init);
-else if ( !strcmp(name,"samplel_result_limits_") ) return (void *)FORTRAN(samplel_result_limits);
-else if ( !strcmp(name,"samplel_compute_") ) return (void *)FORTRAN(samplel_compute);
-
 /* sampleij.F */
 else if ( !strcmp(name,"sampleij_init_") ) return (void *)sampleij_init_;
 else if ( !strcmp(name,"sampleij_result_limits_") ) return (void *)sampleij_result_limits_;


fixed bug where ferret would crash if internal external functions were accessed and the FER_EXTERNAL_FUNCTION variable was not set

git-svn-id: 0ef30dc7da0b07cedfa074587325a6c153c0ae55@7647 fdbf22ae-c210-0410-be80-ca943da6b8f8

--- fer/ccr/EF_InternalUtil.c
+++ fer/ccr/EF_InternalUtil.c
@@ -339,6 +339,11 @@
  *  int_dlsym.pl.  Check that N_INTEF is correctly defined below.
  */

+  /*  *******NOTE******
+      *kob*  6/01 -  The below initialization code should really be in
+      it's own, separate c routine.  So, the next time and internal
+      external function is added, please move the code to it's own routine */
+
 #define N_INTEF 17

 struct {
@@ -418,7 +423,14 @@
 \nWARNING: environment variable FER_EXTERNAL_FUNCTIONS not defined.\n\n");
       I_have_warned_already = TRUE;
     }
-    return_val = 0;
+    /* *kob* v5.32 - the return val was set to 0 below but that was wrong.
+       That didn't take into account that on any system, the
+       FER_EXTERNAL_FUNCTIONS env variable might not be set.  If that were the
+       case, a core dump occurred on all systems.  Set return_val to count,
+       which was generated above - also have to  note that the ef's
+       have been scanned*/
+    return_val = count;
+    I_have_scanned_already = TRUE;
     return return_val;
   }