Make methods private, add a method.

Make methods private, add a method.

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

--- include/llvm/CodeGen/SelectionDAGISel.h
+++ include/llvm/CodeGen/SelectionDAGISel.h
@@ -50,6 +50,7 @@

   virtual void InstructionSelectBasicBlock(SelectionDAG &SD) = 0;

+private:
   SDOperand CopyValueToVirtualRegister(SelectionDAGLowering &SDL,
                                        Value *V, unsigned Reg);
   void SelectBasicBlock(BasicBlock *BB, MachineFunction &MF,
@@ -58,6 +59,8 @@
   void BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
            std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
                          FunctionLoweringInfo &FuncInfo);
+  void LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL,
+                      std::vector<SDOperand> &UnorderedChains);
 };

 }


added EOS 60D ID.

added EOS 60D ID.

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@13494 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -1100,6 +1100,8 @@
 	{"Canon:PowerShot SX210 IS",		0x04a9, 0x31f6, PTPBUG_DELETE_SENDS_EVENT},
 	/* http://sourceforge.net/tracker/index.php?func=detail&aid=3153412&group_id=8874&atid=358874 */
 	{"Canon:PowerShot SX130 IS",		0x04a9, 0x3211, PTPBUG_DELETE_SENDS_EVENT},
+	/* IRC Reporter */
+	{"Canon:EOS 60D",			0x04a9, 0x3215, PTPBUG_DELETE_SENDS_EVENT},

 	/* Konica-Minolta PTP cameras */
 	{"Konica-Minolta:DiMAGE A2 (PTP mode)",        0x132b, 0x0001, 0},


Fix a typo in VfrCompile
Signed-off-by: ydong10

git-svn-id: f3880c1fc5096ce2109c8aec392d8e07f619f417@2373 c2973edb-eda0-4c78-bc6a-9341b269661f

--- Source/C/VfrCompile/VfrFormPkg.h
+++ Source/C/VfrCompile/VfrFormPkg.h
@@ -847,7 +847,7 @@

 public:
   CIfrImage () : CIfrObj (EFI_IFR_IMAGE_OP, (CHAR8 **)&mImage),
-                 CIfrOpHeader (EFI_IFR_FORM_OP, &mImage->Header) {
+                 CIfrOpHeader (EFI_IFR_IMAGE_OP, &mImage->Header) {
     mImage->Id = EFI_IMAGE_ID_INVALID;
   }


sophia: trace processed number of log records

--- sophia/environment/se_recover.c
+++ sophia/environment/se_recover.c
@@ -66,6 +66,7 @@
 	sedb *db = NULL;
 	ssiter i;
 	ss_iterinit(sl_iter, &i);
+	int processed = 0;
 	int rc = ss_iteropen(sl_iter, &i, &e->r, &log->file, 1);
 	if (ssunlikely(rc == -1))
 		return -1;
@@ -112,6 +113,9 @@
 			if (ssunlikely(rc == -1))
 				goto rlb;
 			ss_gcmark(&log->gc, 1);
+			processed++;
+			if ((processed % 100000) == 0)
+				se_recoverf(e, " %.1fM processed", processed / 1000000.0);
 			ss_iteratornext(&i);
 		}
 		if (ssunlikely(sl_iter_error(&i)))


Reduced browse count to 50 (otherwise Youtube complains)

--- tools/test-ui/main.c
+++ tools/test-ui/main.c
@@ -128,7 +128,7 @@
   ms_media_source_browse (source,
 			  container_id,
 			  browse_keys (),
-			  0, 100,
+			  0, 50,
 			  0,
 			  browse_cb,
 			  NULL);


Fix a couple small performance issues in erase()

--- parallel_hashmap/phmap.h
+++ parallel_hashmap/phmap.h
@@ -78,7 +78,7 @@
     }
 };

-#ifdef PHMAP_HAS_UMUL128
+#if defined(PHMAP_HAS_UMUL128)
     template<>
     struct phmap_mix<8>
     {
@@ -1639,7 +1639,7 @@
     size_type erase(const key_arg<K>& key) {
         auto it = find(key);
         if (it == end()) return 0;
-        erase(it);
+        _erase(it);
         return 1;
     }

@@ -1671,7 +1671,7 @@

     iterator erase(const_iterator first, const_iterator last) {
         while (first != last) {
-            erase(first++);
+            _erase(first++);
         }
         return last.inner_;
     }
@@ -3112,7 +3112,7 @@
             return 0;

         typename Lockable::UpgradeToUnique unique(m);
-        set.erase(it);
+        set._erase(it);
         return 1;
     }

@@ -3145,7 +3145,7 @@

     iterator erase(const_iterator first, const_iterator last) {
         while (first != last) {
-            erase(first++);
+            _erase(first++);
         }
         return last.iter_;
     }


2010 is the year

2010 is the year

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@12764 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -1,7 +1,7 @@
 /* library.c
  *
  * Copyright (C) 2001-2005 Mariusz Woloszyn <emsi@ipartners.pl>
- * Copyright (C) 2003-2009 Marcus Meissner <marcus@jet.franken.de>
+ * Copyright (C) 2003-2010 Marcus Meissner <marcus@jet.franken.de>
  * Copyright (C) 2005 Hubert Figuiere <hfiguiere@teaser.fr>
  * Copyright (C) 2009 Axel Waggershauser <awagger@web.de>
  *
@@ -1428,7 +1428,7 @@
 	   "This driver supports cameras that support PTP or PictBridge(tm), and\n"
 	   "Media Players that support the Media Transfer Protocol (MTP).\n"
 	   "\n"
-	   "Enjoy!"), 2009);
+	   "Enjoy!"), 2010);
 	return (GP_OK);
 }


ASoC: wcd9xxx: Avoid mic schmitt trigger while finding plug type

Do not enable mic schmitt trigger when the plug type
determination work is interrupted by another mechanical
or electrical mbhc interrupt. Otherwise, enabling mic
schmitt trigger will cause spurious unwanted electrical
interrupts to be generated while plug type is getting
determined.

Change-Id: I3dce10b874c903ec517a6683cbcbc8d2a3d82c92
Signed-off-by: Phani Kumar Uppalapati <0898c4e5c8d849879fa65e9f23cfa9cb45bd5a93@codeaurora.org>

--- sound/soc/codecs/wcd9xxx-mbhc.c
+++ sound/soc/codecs/wcd9xxx-mbhc.c
@@ -2170,6 +2170,7 @@
 	unsigned long timeout;
 	int retry = 0, pt_gnd_mic_swap_cnt = 0;
 	bool correction = false;
+	bool wrk_complete = true;

 	pr_debug("%s: enter\n", __func__);

@@ -2195,12 +2196,14 @@
 		++retry;
 		rmb();
 		if (mbhc->hs_detect_work_stop) {
+			wrk_complete = false;
 			pr_debug("%s: stop requested\n", __func__);
 			break;
 		}

 		msleep(HS_DETECT_PLUG_INERVAL_MS);
 		if (wcd9xxx_swch_level_remove(mbhc)) {
+			wrk_complete = false;
 			pr_debug("%s: Switch level is low\n", __func__);
 			break;
 		}
@@ -2274,7 +2277,9 @@
 	if (plug_type == PLUG_TYPE_HIGH_HPH) {
 		pr_debug("%s: polling is done, still HPH, so enabling MIC trigger\n",
 			 __func__);
+		WCD9XXX_BCL_LOCK(mbhc->resmgr);
 		wcd9xxx_find_plug_and_report(mbhc, plug_type);
+		WCD9XXX_BCL_UNLOCK(mbhc->resmgr);
 	}
 	/* Turn off override */
 	if (!correction)
@@ -2284,10 +2289,11 @@

 	if (mbhc->mbhc_cfg->detect_extn_cable) {
 		WCD9XXX_BCL_LOCK(mbhc->resmgr);
-		if (mbhc->current_plug == PLUG_TYPE_HEADPHONE ||
+		if ((mbhc->current_plug == PLUG_TYPE_HEADPHONE &&
+		    wrk_complete) ||
 		    mbhc->current_plug == PLUG_TYPE_GND_MIC_SWAP ||
 		    mbhc->current_plug == PLUG_TYPE_INVALID ||
-		    plug_type == PLUG_TYPE_INVALID) {
+		    (plug_type == PLUG_TYPE_INVALID && wrk_complete)) {
 			/* Enable removal detection */
 			wcd9xxx_cleanup_hs_polling(mbhc);
 			wcd9xxx_enable_hs_detect(mbhc, 0, 0, false);


virsh: Add target completion to dompmsuspend command

Signed-off-by: Lin Ma <b672e1c95326414c5ec2f68d68657d26580eb0bc@suse.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

--- tools/virsh-domain.c
+++ tools/virsh-domain.c
@@ -3454,6 +3454,7 @@
     {.name = "target",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
+     .completer = virshNodeSuspendTargetCompleter,
      .help = N_("mem(Suspend-to-RAM), "
                 "disk(Suspend-to-Disk), "
                 "hybrid(Hybrid-Suspend)")


parser/tests: Use 4-spaces-indentation for comments in tests

--- parser/tests/run_tests.c
+++ parser/tests/run_tests.c
@@ -285,7 +285,7 @@
 }

 START_TEST(parse_implied_field)
-  // Check implied field with .buf
+    // Check implied field with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_BUF), gen_sid_spec(&user, 0));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -293,7 +293,7 @@
     check_parse_implied_field(specs, sizeof specs / sizeof specs[0], &parse_user_args);
   }

-  // Check implied field with .run
+    // Check implied field with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_RUN), gen_sid_spec(&user, 0));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -303,7 +303,7 @@
 END_TEST

 START_TEST(parse_implied_field_with_name)
-  // Check implied field with .buf & .name
+    // Check implied field with .buf & .name
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_BUF | SPEC_NAME), gen_sid_spec(&user, 0));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -316,7 +316,7 @@
     ASSERT_STR_EQ(user.name, user.name_size, "John Smith");
   }

-  // Check implied field with .run & .name
+    // Check implied field with .run & .name
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_RUN | SPEC_NAME), gen_sid_spec(&user, 0));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -366,7 +366,7 @@
 }

 START_TEST(parse_implied_field_max_size)
-  // Check implied field with .buf
+    // Check implied field with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_BUF), gen_sid_spec(&user, 0));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -374,7 +374,7 @@
     check_parse_implied_field_max_size(specs, sizeof specs / sizeof specs[0], &parse_user_args);
   }

-  // Check implied field with .run
+    // Check implied field with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_RUN), gen_sid_spec(&user, 0));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -401,7 +401,7 @@
 }

 START_TEST(parse_implied_field_max_size_plus_one)
-  // Check implied field with .buf
+    // Check implied field with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_BUF));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -409,7 +409,7 @@
     check_parse_implied_field_max_size_plus_one(specs, sizeof specs / sizeof specs[0], &parse_user_args);
   }

-  // Check implied field with .run
+    // Check implied field with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_RUN));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -436,7 +436,7 @@
 }

 START_TEST(parse_implied_field_size_NAME_SIZE_plus_one)
-  // Check implied field with .buf
+    // Check implied field with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_BUF));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -444,7 +444,7 @@
     check_parse_implied_field_size_NAME_SIZE_plus_one(specs, sizeof specs / sizeof specs[0], &parse_user_args);
   }

-  // Check implied field with .run
+    // Check implied field with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_name_spec(&user, SPEC_RUN));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -553,7 +553,7 @@
 }

 START_TEST(parse_value_terminal_empty)
-  // Check field with terminal value with .buf
+    // Check field with terminal value with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_BUF));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -561,7 +561,7 @@
     check_parse_value_terminal_empty(specs, sizeof specs / sizeof specs[0]);
   }

-  // Check field with terminal value with .run
+    // Check field with terminal value with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_RUN));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -587,7 +587,7 @@
 }

 START_TEST(parse_value_terminal_max_size)
-  // Check field with terminal value with .buf
+    // Check field with terminal value with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_BUF));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -595,7 +595,7 @@
     check_parse_value_terminal_max_size(specs, sizeof specs / sizeof specs[0], &parse_user_args);
   }

-  // Check field with terminal value with .run
+    // Check field with terminal value with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_RUN));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -615,7 +615,7 @@
 }

 START_TEST(parse_value_terminal_max_size_plus_one)
-  // Check field with terminal value with .buf
+    // Check field with terminal value with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_BUF));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -623,7 +623,7 @@
     check_parse_value_terminal_max_size_plus_one(specs, sizeof specs / sizeof specs[0]);
   }

-  // Check field with terminal value with .run
+    // Check field with terminal value with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_RUN));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -649,7 +649,7 @@
 }

 START_TEST(parse_value_terminal_NAME_SIZE_plus_one)
-  // Check field with terminal value with .buf
+    // Check field with terminal value with .buf
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_BUF));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };
@@ -657,7 +657,7 @@
     check_parse_value_terminal_NAME_SIZE_plus_one(specs, sizeof specs / sizeof specs[0]);
   }

-  // Check field with terminal value with .run
+    // Check field with terminal value with .run
   {
     DEFINE_TaskSpecs(parse_user_args, gen_sid_spec(&user, SPEC_RUN));
     struct kndTaskSpec specs[] = { gen_user_spec(&parse_user_args) };


ASoC: davinci-pcm: trivial: replace link with actual chan/link

The ambiguously named variable 'link' is used as a temporary throughout
davinci-pcm -- its presence makes grepping (and groking) the code
difficult.

Replace link with the value of link in almost all sites. The exception
is a couple places where the last-assigned link/chan needs to be
returned by a function -- in these cases, rename to last_link.

Signed-off-by: Ben Gardiner <70df8feb3ef5e98f393abcbbb2227739b5f9dc64@nanometrics.ca>
Acked-by: Liam Girdwood <a57ef363056e61beffa2efa59c68550d40db03b0@ti.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/davinci/davinci-pcm.c
+++ sound/soc/davinci/davinci-pcm.c
@@ -180,7 +180,6 @@
 {
 	struct davinci_runtime_data *prtd = substream->runtime->private_data;
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	int link = prtd->asp_link[0];
 	unsigned int period_size;
 	unsigned int dma_offset;
 	dma_addr_t dma_pos;
@@ -198,7 +197,8 @@
 	fifo_level = prtd->params->fifo_level;

 	pr_debug("davinci_pcm: audio_set_dma_params_play channel = %d "
-		"dma_ptr = %x period_size=%x\n", link, dma_pos, period_size);
+		"dma_ptr = %x period_size=%x\n", prtd->asp_link[0], dma_pos,
+		period_size);

 	data_type = prtd->params->data_type;
 	count = period_size / data_type;
@@ -222,17 +222,19 @@
 	}

 	acnt = prtd->params->acnt;
-	edma_set_src(link, src, INCR, W8BIT);
-	edma_set_dest(link, dst, INCR, W8BIT);
-
-	edma_set_src_index(link, src_bidx, src_cidx);
-	edma_set_dest_index(link, dst_bidx, dst_cidx);
+	edma_set_src(prtd->asp_link[0], src, INCR, W8BIT);
+	edma_set_dest(prtd->asp_link[0], dst, INCR, W8BIT);
+
+	edma_set_src_index(prtd->asp_link[0], src_bidx, src_cidx);
+	edma_set_dest_index(prtd->asp_link[0], dst_bidx, dst_cidx);

 	if (!fifo_level)
-		edma_set_transfer_params(link, acnt, count, 1, 0, ASYNC);
+		edma_set_transfer_params(prtd->asp_link[0], acnt, count, 1, 0,
+							ASYNC);
 	else
-		edma_set_transfer_params(link, acnt, fifo_level, count,
-							fifo_level, ABSYNC);
+		edma_set_transfer_params(prtd->asp_link[0], acnt, fifo_level,
+							count, fifo_level,
+							ABSYNC);
 }

 static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data)
@@ -305,7 +307,6 @@
 	unsigned int acnt = params->acnt;
 	/* divide by 2 for ping/pong */
 	unsigned int ping_size = snd_pcm_lib_period_bytes(substream) >> 1;
-	int link = prtd->asp_link[1];
 	unsigned int fifo_level = prtd->params->fifo_level;
 	unsigned int count;
 	if ((data_type == 0) || (data_type > 4)) {
@@ -316,28 +317,26 @@
 		dma_addr_t asp_src_pong = iram_dma->addr + ping_size;
 		ram_src_cidx = ping_size;
 		ram_dst_cidx = -ping_size;
-		edma_set_src(link, asp_src_pong, INCR, W8BIT);
-
-		link = prtd->asp_link[0];
-		edma_set_src_index(link, data_type, data_type * fifo_level);
-		link = prtd->asp_link[1];
-		edma_set_src_index(link, data_type, data_type * fifo_level);
-
-		link = prtd->ram_link;
-		edma_set_src(link, runtime->dma_addr, INCR, W32BIT);
+		edma_set_src(prtd->asp_link[1], asp_src_pong, INCR, W8BIT);
+
+		edma_set_src_index(prtd->asp_link[0], data_type,
+				data_type * fifo_level);
+		edma_set_src_index(prtd->asp_link[1], data_type,
+				data_type * fifo_level);
+
+		edma_set_src(prtd->ram_link, runtime->dma_addr, INCR, W32BIT);
 	} else {
 		dma_addr_t asp_dst_pong = iram_dma->addr + ping_size;
 		ram_src_cidx = -ping_size;
 		ram_dst_cidx = ping_size;
-		edma_set_dest(link, asp_dst_pong, INCR, W8BIT);
-
-		link = prtd->asp_link[0];
-		edma_set_dest_index(link, data_type, data_type * fifo_level);
-		link = prtd->asp_link[1];
-		edma_set_dest_index(link, data_type, data_type * fifo_level);
-
-		link = prtd->ram_link;
-		edma_set_dest(link, runtime->dma_addr, INCR, W32BIT);
+		edma_set_dest(prtd->asp_link[1], asp_dst_pong, INCR, W8BIT);
+
+		edma_set_dest_index(prtd->asp_link[0], data_type,
+				data_type * fifo_level);
+		edma_set_dest_index(prtd->asp_link[1], data_type,
+				data_type * fifo_level);
+
+		edma_set_dest(prtd->ram_link, runtime->dma_addr, INCR, W32BIT);
 	}

 	if (!fifo_level) {
@@ -354,10 +353,9 @@
 				count, fifo_level, ABSYNC);
 	}

-	link = prtd->ram_link;
-	edma_set_src_index(link, ping_size, ram_src_cidx);
-	edma_set_dest_index(link, ping_size, ram_dst_cidx);
-	edma_set_transfer_params(link, ping_size, 2,
+	edma_set_src_index(prtd->ram_link, ping_size, ram_src_cidx);
+	edma_set_dest_index(prtd->ram_link, ping_size, ram_dst_cidx);
+	edma_set_transfer_params(prtd->ram_link, ping_size, 2,
 			runtime->periods, 2, ASYNC);

 	/* init master params */
@@ -406,32 +404,32 @@
 {
 	dma_addr_t asp_src_ping;
 	dma_addr_t asp_dst_ping;
-	int link;
+	int ret;
 	struct davinci_pcm_dma_params *params = prtd->params;

 	/* Request ram master channel */
-	link = prtd->ram_channel = edma_alloc_channel(EDMA_CHANNEL_ANY,
+	ret = prtd->ram_channel = edma_alloc_channel(EDMA_CHANNEL_ANY,
 				  davinci_pcm_dma_irq, substream,
 				  prtd->params->ram_chan_q);
-	if (link < 0)
+	if (ret < 0)
 		goto exit1;

 	/* Request ram link channel */
-	link = prtd->ram_link = edma_alloc_slot(
+	ret = prtd->ram_link = edma_alloc_slot(
 			EDMA_CTLR(prtd->ram_channel), EDMA_SLOT_ANY);
-	if (link < 0)
+	if (ret < 0)
 		goto exit2;

-	link = prtd->asp_link[1] = edma_alloc_slot(
+	ret = prtd->asp_link[1] = edma_alloc_slot(
 			EDMA_CTLR(prtd->asp_channel), EDMA_SLOT_ANY);
-	if (link < 0)
+	if (ret < 0)
 		goto exit3;

 	prtd->ram_link2 = -1;
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		link = prtd->ram_link2 = edma_alloc_slot(
+		ret = prtd->ram_link2 = edma_alloc_slot(
 			EDMA_CTLR(prtd->ram_channel), EDMA_SLOT_ANY);
-		if (link < 0)
+		if (ret < 0)
 			goto exit4;
 	}
 	/* circle ping-pong buffers */
@@ -448,36 +446,33 @@
 		asp_dst_ping = iram_dma->addr;
 	}
 	/* ping */
-	link = prtd->asp_link[0];
-	edma_set_src(link, asp_src_ping, INCR, W16BIT);
-	edma_set_dest(link, asp_dst_ping, INCR, W16BIT);
-	edma_set_src_index(link, 0, 0);
-	edma_set_dest_index(link, 0, 0);
-
-	edma_read_slot(link, &prtd->asp_params);
+	edma_set_src(prtd->asp_link[0], asp_src_ping, INCR, W16BIT);
+	edma_set_dest(prtd->asp_link[0], asp_dst_ping, INCR, W16BIT);
+	edma_set_src_index(prtd->asp_link[0], 0, 0);
+	edma_set_dest_index(prtd->asp_link[0], 0, 0);
+
+	edma_read_slot(prtd->asp_link[0], &prtd->asp_params);
 	prtd->asp_params.opt &= ~(TCCMODE | EDMA_TCC(0x3f) | TCINTEN);
 	prtd->asp_params.opt |= TCCHEN |
 		EDMA_TCC(prtd->ram_channel & 0x3f);
-	edma_write_slot(link, &prtd->asp_params);
+	edma_write_slot(prtd->asp_link[0], &prtd->asp_params);

 	/* pong */
-	link = prtd->asp_link[1];
-	edma_set_src(link, asp_src_ping, INCR, W16BIT);
-	edma_set_dest(link, asp_dst_ping, INCR, W16BIT);
-	edma_set_src_index(link, 0, 0);
-	edma_set_dest_index(link, 0, 0);
-
-	edma_read_slot(link, &prtd->asp_params);
+	edma_set_src(prtd->asp_link[1], asp_src_ping, INCR, W16BIT);
+	edma_set_dest(prtd->asp_link[1], asp_dst_ping, INCR, W16BIT);
+	edma_set_src_index(prtd->asp_link[1], 0, 0);
+	edma_set_dest_index(prtd->asp_link[1], 0, 0);
+
+	edma_read_slot(prtd->asp_link[1], &prtd->asp_params);
 	prtd->asp_params.opt &= ~(TCCMODE | EDMA_TCC(0x3f));
 	/* interrupt after every pong completion */
 	prtd->asp_params.opt |= TCINTEN | TCCHEN |
 		EDMA_TCC(prtd->ram_channel & 0x3f);
-	edma_write_slot(link, &prtd->asp_params);
+	edma_write_slot(prtd->asp_link[1], &prtd->asp_params);

 	/* ram */
-	link = prtd->ram_link;
-	edma_set_src(link, iram_dma->addr, INCR, W32BIT);
-	edma_set_dest(link, iram_dma->addr, INCR, W32BIT);
+	edma_set_src(prtd->ram_link, iram_dma->addr, INCR, W32BIT);
+	edma_set_dest(prtd->ram_link, iram_dma->addr, INCR, W32BIT);
 	pr_debug("%s: audio dma channels/slots in use for ram:%u %u %u,"
 		"for asp:%u %u %u\n", __func__,
 		prtd->ram_channel, prtd->ram_link, prtd->ram_link2,
@@ -494,7 +489,7 @@
 	edma_free_channel(prtd->ram_channel);
 	prtd->ram_channel = -1;
 exit1:
-	return link;
+	return ret;
 }

 static int davinci_pcm_dma_request(struct snd_pcm_substream *substream)
@@ -502,22 +497,22 @@
 	struct snd_dma_buffer *iram_dma;
 	struct davinci_runtime_data *prtd = substream->runtime->private_data;
 	struct davinci_pcm_dma_params *params = prtd->params;
-	int link;
+	int ret;

 	if (!params)
 		return -ENODEV;

 	/* Request asp master DMA channel */
-	link = prtd->asp_channel = edma_alloc_channel(params->channel,
+	ret = prtd->asp_channel = edma_alloc_channel(params->channel,
 			davinci_pcm_dma_irq, substream,
 			prtd->params->asp_chan_q);
-	if (link < 0)
+	if (ret < 0)
 		goto exit1;

 	/* Request asp link channels */
-	link = prtd->asp_link[0] = edma_alloc_slot(
+	ret = prtd->asp_link[0] = edma_alloc_slot(
 			EDMA_CTLR(prtd->asp_channel), EDMA_SLOT_ANY);
-	if (link < 0)
+	if (ret < 0)
 		goto exit2;

 	iram_dma = (struct snd_dma_buffer *)substream->dma_buffer.private_data;
@@ -537,17 +532,17 @@
 	 * the buffer and its length (ccnt) ... use it as a template
 	 * so davinci_pcm_enqueue_dma() takes less time in IRQ.
 	 */
-	edma_read_slot(link, &prtd->asp_params);
+	edma_read_slot(prtd->asp_link[0], &prtd->asp_params);
 	prtd->asp_params.opt |= TCINTEN |
 		EDMA_TCC(EDMA_CHAN_SLOT(prtd->asp_channel));
-	prtd->asp_params.link_bcntrld = EDMA_CHAN_SLOT(link) << 5;
-	edma_write_slot(link, &prtd->asp_params);
+	prtd->asp_params.link_bcntrld = EDMA_CHAN_SLOT(prtd->asp_link[0]) << 5;
+	edma_write_slot(prtd->asp_link[0], &prtd->asp_params);
 	return 0;
 exit2:
 	edma_free_channel(prtd->asp_channel);
 	prtd->asp_channel = -1;
 exit1:
-	return link;
+	return ret;
 }

 static int davinci_pcm_trigger(struct snd_pcm_substream *substream, int cmd)


[SRC] Switch ZMQ socket type to IPC

[SRC] Switch ZMQ socket type to IPC

--- metadata_input_zeromq.c
+++ metadata_input_zeromq.c
@@ -87,14 +87,14 @@
     if (((miz->md_nl_mask & META_TYPE_INTERFACE) ||
         (miz->md_nl_mask & META_TYPE_POS) ||
         (miz->md_nl_mask & META_TYPE_RADIO)) &&
-        zmq_connect(miz->zmq_socket, "tcp://localhost:" ZMQ_NL_PUBLISHER_PORT) == -1)
+        zmq_connect(miz->zmq_socket, "ipc:///tmp/nl_pub") == -1)
     {
         META_PRINT_SYSLOG(miz->parent, LOG_ERR, "Can't connect to NL ZMQ publisher\n");
         return RETVAL_FAILURE;
     }

     if ((miz->md_nl_mask & META_TYPE_CONNECTION) &&
-        zmq_connect(miz->zmq_socket, "tcp://localhost:" ZMQ_DLB_PUBLISHER_PORT) == -1)
+        zmq_connect(miz->zmq_socket, "ipc:///tmp/dlb_pub") == -1)
     {
         META_PRINT_SYSLOG(miz->parent, LOG_ERR, "Can't connect to DLB ZMQ publisher\n");
         return RETVAL_FAILURE;


virsh migrate: Properly check for --parallel-connections

Ever since --parallel-connections option for virsh migrate was
introduced we did not properly check the return value of
vshCommandOptInt. We would set VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS
parameter even if vshCommandOptInt returned 0 (which means
--parallel-connections was not specified) when another int option which
was checked earlier was specified with a nonzero value.

Specifically, running virsh migrate with either
--auto-converge-increment, --auto-converge-initial, --comp-mt-dthreads,
--comp-mt-threads, or --comp-mt-level would set
VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS parameter and if --parallel
option was not used, libvirt would complain

    error: invalid argument: Turn parallel migration on to tune it

even though --parallel-connections option was not used at all.

https://bugzilla.redhat.com/show_bug.cgi?id=1726643

Signed-off-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

--- tools/virsh-domain.c
+++ tools/virsh-domain.c
@@ -10785,13 +10785,14 @@
             goto save_error;
     }

-    if (vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt) < 0)
+    if ((rv = vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt)) < 0) {
         goto out;
-    if (intOpt &&
-        virTypedParamsAddInt(&params, &nparams, &maxparams,
-                             VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS,
-                             intOpt) < 0)
-        goto save_error;
+    } else if (rv > 0) {
+        if (virTypedParamsAddInt(&params, &nparams, &maxparams,
+                                 VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS,
+                                 intOpt) < 0)
+            goto save_error;
+    }

     if (vshCommandOptBool(cmd, "live"))
         flags |= VIR_MIGRATE_LIVE;


ASoC: Don't specify the DMA driver for Goni baseband link

Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <0830630c6cd5183ace1d4c7d6bf00ba9c2282b5f@gmail.com>
Acked-by: Liam Girdwood <a57ef363056e61beffa2efa59c68550d40db03b0@ti.com>

--- sound/soc/samsung/goni_wm8994.c
+++ sound/soc/samsung/goni_wm8994.c
@@ -246,7 +246,6 @@
 	.stream_name = "Voice",
 	.cpu_dai_name = "goni-voice-dai",
 	.codec_dai_name = "wm8994-aif2",
-	.platform_name = "samsung-audio",
 	.codec_name = "wm8994-codec.0-001a",
 	.ops = &goni_voice_ops,
 },


Update aes.h

Update aes.h

found small mistake in it

we have:

PROVIDE ( ets_aes_crypt = 0x4005c9b8 );
PROVIDE ( ets_aes_disable = 0x4005c8f8 );
PROVIDE ( ets_aes_enable = 0x4005c8cc );
PROVIDE ( ets_aes_set_endian = 0x4005c928 );
PROVIDE ( ets_aes_setkey_dec = 0x4005c994 );
PROVIDE ( ets_aes_setkey_enc = 0x4005c97c );

Signed-off-by: Ivan Grokhotkov <a15f8b81a160b4eebe5c84e9e3b65c87b9b2f18e@espressif.com>

--- components/esp32/include/rom/aes.h
+++ components/esp32/include/rom/aes.h
@@ -31,7 +31,7 @@

 void ets_aes_disable(void);

-void ets_set_endian(bool key_word_swap, bool key_byte_swap,
+void ets_aes_set_endian(bool key_word_swap, bool key_byte_swap,
                     bool in_word_swap, bool in_byte_swap,
                     bool out_word_swap, bool out_byte_swap);


Keep rd_newRelfilenodeSubid across overflow.
Teach RelationCacheInvalidate() to keep rd_newRelfilenodeSubid across rel cache
message overflows, so that behaviour is now fully deterministic.

Noah Misch

--- src/backend/utils/cache/relcache.c
+++ src/backend/utils/cache/relcache.c
@@ -2163,8 +2163,14 @@
 		/* Must close all smgr references to avoid leaving dangling ptrs */
 		RelationCloseSmgr(relation);

-		/* Ignore new relations, since they are never cross-backend targets */
-		if (relation->rd_createSubid != InvalidSubTransactionId)
+		/*
+		 * Ignore new relations; no other backend will manipulate them before
+		 * we commit.  Likewise, before replacing a relation's relfilenode, we
+		 * shall have acquired AccessExclusiveLock and drained any applicable
+		 * pending invalidations.
+		 */
+		if (relation->rd_createSubid != InvalidSubTransactionId ||
+			relation->rd_newRelfilenodeSubid != InvalidSubTransactionId)
 			continue;

 		relcacheInvalsReceived++;


Refactor example app a bit.

Refactor example app a bit.

git-svn-id: 7d68aab30a7b7da04c9f50fd8fb788f5df4f1c4e@444 d91c8aed-3f2b-0410-a83d-924a1c20a0ba

--- examples/mc-example.c
+++ examples/mc-example.c
@@ -74,6 +74,15 @@
 }

 static void
+on_string_changed (McAccount *account, GQuark string, const gchar *text,
+		   gpointer userdata)
+{
+    g_debug ("%s changed for account %s:\n  new string: %s",
+	     g_quark_to_string (string), account->name,
+	     text);
+}
+
+static void
 on_presence_changed (McAccount *account, GQuark presence, TpConnectionPresenceType type,
 		     const gchar *status, const gchar *message, gpointer userdata)
 {
@@ -95,6 +104,9 @@
 {
     g_debug ("%s flag changed for account %s: %d",
 	     g_quark_to_string (flag), account->name, value);
+
+    if (flag == MC_QUARK_VALID && !value)
+	g_object_unref (account);
 }

 static void
@@ -133,6 +145,39 @@
 }

 static void
+on_account_removed (TpProxy *proxy, gpointer user_data, GObject *weak_object)
+{
+    McAccount *account = MC_ACCOUNT (proxy);
+    g_debug ("Account %s removed", account->name);
+    g_object_unref (account);
+}
+
+static void
+watch_account (McAccount *account)
+{
+    g_debug ("watching account %s, manager %s, protocol %s",
+	     account->name, account->manager_name, account->protocol_name);
+
+    mc_cli_account_connect_to_removed (account, on_account_removed,
+				       NULL, NULL, NULL, NULL);
+    g_signal_connect (account, "string-changed",
+		      G_CALLBACK (on_string_changed), NULL);
+    g_signal_connect (account, "presence-changed::current",
+		      G_CALLBACK (on_presence_changed), NULL);
+    g_signal_connect (account, "connection-status-changed",
+		      G_CALLBACK (on_connection_status_changed), NULL);
+    g_signal_connect (account, "flag-changed",
+		      G_CALLBACK (on_flag_changed), NULL);
+    g_signal_connect (account, "parameters-changed",
+		      G_CALLBACK (on_parameters_changed), NULL);
+    g_signal_connect (account, "avatar-changed",
+		      G_CALLBACK (on_avatar_changed), NULL);
+
+    mc_account_call_when_ready (account, ready_cb, NULL);
+    mc_account_avatar_call_when_ready (account, avatar_ready_cb, NULL);
+}
+
+static void
 am_ready (McAccountManager *am, const GError *error, gpointer user_data)
 {
     const gchar * const *accounts, * const *name;
@@ -150,21 +195,8 @@
 	McAccount *account;

 	account = mc_account_new (((TpProxy *)am)->dbus_daemon, *name);
-	g_debug ("account %s, manager %s, protocol %s",
-		 account->name, account->manager_name, account->protocol_name);
-	g_signal_connect (account, "presence-changed::current",
-			  G_CALLBACK (on_presence_changed), NULL);
-	g_signal_connect (account, "connection-status-changed",
-			  G_CALLBACK (on_connection_status_changed), NULL);
-	g_signal_connect (account, "flag-changed",
-			  G_CALLBACK (on_flag_changed), NULL);
-	g_signal_connect (account, "parameters-changed",
-			  G_CALLBACK (on_parameters_changed), NULL);
-	g_signal_connect (account, "avatar-changed",
-			  G_CALLBACK (on_avatar_changed), NULL);
-
-	mc_account_call_when_ready (account, ready_cb, NULL);
-	mc_account_avatar_call_when_ready (account, avatar_ready_cb, NULL);
+
+	watch_account (account);
     }

 }
@@ -213,6 +245,15 @@
     for (name = accounts; *name != NULL; name++)
     {
 	g_debug ("  %s", *name);
+    }
+
+    if (valid)
+    {
+	McAccount *account;
+
+	account = mc_account_new (proxy->dbus_daemon, path);
+
+	watch_account (account);
     }
 }


tools: virsh: split variable declarations

One variable per line.

Signed-off-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>
Reviewed-by: Martin Kletzander <e82f23e74d43760279ebcc505dac4ae70d5627d0@redhat.com>

--- tools/virsh-domain.c
+++ tools/virsh-domain.c
@@ -5912,7 +5912,8 @@
     const char *mode = NULL;
     int flags = 0;
     int rv;
-    char **modes = NULL, **tmp;
+    char **modes = NULL;
+    char **tmp;

     if (vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0)
         return false;
@@ -5996,7 +5997,8 @@
     const char *name;
     const char *mode = NULL;
     int flags = 0;
-    char **modes = NULL, **tmp;
+    char **modes = NULL;
+    char **tmp;

     if (vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0)
         return false;
@@ -12166,7 +12168,8 @@
     xmlXPathObjectPtr obj = NULL;
     xmlXPathContextPtr ctxt = NULL;
     xmlNodePtr cur = NULL, matchNode = NULL;
-    char *detach_xml = NULL, buf[64];
+    char *detach_xml = NULL;
+    char buf[64];
     int diff_mac, ret = -1;
     size_t i;


Fix typo in comment

Fix typo in comment

Arthur Zakirov, confirmed by Thomas Munro

--- src/backend/utils/cache/typcache.c
+++ src/backend/utils/cache/typcache.c
@@ -198,7 +198,7 @@
 } SharedTypmodTableEntry;

 /*
- * A comparator function for SharedTupleDescTableKey.
+ * A comparator function for SharedRecordTableKey.
  */
 static int
 shared_record_table_compare(const void *a, const void *b, size_t size,


virsh: cmdSetUserSSHKeys: Error early if the file doesn't contain any keys

When removing SSH keys via set-user-sshkeys virsh command, then
files to remove are read from passed file. But when
experimenting, I've passed /dev/null as the file which resulted
in API checks which caught that @keys argument of
virDomainAuthorizedSSHKeysSet() can't be NULL. This is because if
the file is empty then its content is an empty string and thus
the buffer the file was read in to is not NULL.

Long story short, error is reported correctly, but it's not
necessary to go through public API to catch it.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

--- tools/virsh-domain.c
+++ tools/virsh-domain.c
@@ -14398,6 +14398,10 @@
             goto cleanup;

         nkeys = virStringListLength((const char **) keys);
+        if (nkeys == 0) {
+            vshError(ctl, _("File %s contains no keys"), from);
+            goto cleanup;
+        }
     }

     if (virDomainAuthorizedSSHKeysSet(dom, user,


Prune SwapStar moves based on capacity bounds.

--- src/algorithms/local_search/swap_star_utils.h
+++ src/algorithms/local_search/swap_star_utils.h
@@ -226,11 +226,18 @@
   auto best_choice = empty_choice;
   Gain best_gain = best_known_gain;

+  const auto& v_source = input.vehicles[source.vehicle_rank];
+  const auto& v_target = input.vehicles[target.vehicle_rank];
+
+  const auto& s_delivery_margin = source.delivery_margin();
+  const auto& s_pickup_margin = source.pickup_margin();
+  const auto& t_delivery_margin = target.delivery_margin();
+  const auto& t_pickup_margin = target.pickup_margin();
+
   for (const auto& s_element : top_insertions_in_target) {
     const auto s_rank = s_element.first;
     const auto& target_insertions = s_element.second;

-    const auto& v_source = input.vehicles[source.vehicle_rank];
     // sol_state.node_gains contains the Delta value we're looking for
     // except in the case of a single-step route with a start and end,
     // where the start->end cost is not accounted for.
@@ -246,7 +253,6 @@
       const auto t_rank = t_element.first;
       const auto& source_insertions = t_element.second;

-      const auto& v_target = input.vehicles[target.vehicle_rank];
       // Same as above.
       const auto target_start_end_cost =
         (target.size() == 1 and v_target.has_start() and v_target.has_end())
@@ -366,6 +372,22 @@
       for (const auto& sc : swap_choice_options) {
         // Browse interesting options by decreasing gain and check for
         // validity.
+
+        // Early abort on invalid capacity bounds.
+        const auto s_index = source.route[sc.s_rank];
+        const auto& s_delivery = input.jobs[s_index].delivery;
+        const auto& s_pickup = input.jobs[s_index].pickup;
+        const auto t_index = target.route[sc.t_rank];
+        const auto& t_delivery = input.jobs[t_index].delivery;
+        const auto& t_pickup = input.jobs[t_index].pickup;
+
+        if (!(t_delivery <= s_delivery_margin + s_delivery) or
+            !(t_pickup <= s_pickup_margin + s_pickup) or
+            !(s_delivery <= t_delivery_margin + t_delivery) or
+            !(s_pickup <= t_pickup_margin + t_pickup)) {
+          continue;
+        }
+
         const auto s_insert = get_insert_range(source.route,
                                                s_rank,
                                                target.route[t_rank],


[gdt] Add access flag defs in gdt_int.h

[gdt] Add access flag defs in gdt_int.h

--- kernel/arch/i386/gdt_int.h
+++ kernel/arch/i386/gdt_int.h
@@ -11,6 +11,54 @@
 #define GDT_16BIT (0)

 #define GDT_REGULAR_32BIT_SEG (GDT_GRAN_4KB | GDT_32BIT)
+
+#define GDT_ACCESS_ACC     (1 << 0)  /*
+                                      * Accessed bit. The CPU sets it to 1 when
+                                      * the segment is accessed.
+                                      */
+
+#define GDT_ACCESS_RW      (1 << 1)  /*
+                                      * For code segments it means readable,
+                                      * otherwise the segment is unreadable.
+                                      * [code segments cannot be writable.]
+                                      *
+                                      * For data segments, it means writable.
+                                      */
+
+#define GDT_ACCESS_DC      (1 << 2)  /*
+                                      * Direction/Conforming bit
+                                      *
+                                      * For data segments: direction.
+                                      *   0 the segment grows up (regular)
+                                      *   1 the segment grown down
+                                      *
+                                      * For code segments: conforming.
+                                      *
+                                      *   0 the code can be executed only from
+                                      *     the ring set in PL.
+                                      *
+                                      *   1 the code can be executed also from
+                                      *     a lower priv. level. E.g. code in
+                                      *     ring 3 can far-jump to conforming
+                                      *     code in ring 2.
+                                      */
+
+#define GDT_ACCESS_EX       (1 << 3)  /*
+                                       * Executable bit.
+                                       *  0 means a data segment
+                                       *  1 means a code segment
+                                       */
+
+#define GDT_ACCESS_ALWAYS1  (1 << 4)   /* Reserved: must be always 1 */
+
+#define GDT_ACCESS_PRIV_0   (0 << 5)   /* Ring 0 */
+#define GDT_ACCESS_PRIV_1   (1 << 5)   /* Ring 1 */
+#define GDT_ACCESS_PRIV_2   (2 << 5)   /* Ring 2 */
+#define GDT_ACCESS_PRIV_3   (3 << 5)   /* Ring 3 */
+
+#define GDT_ACCESS_PRESENT  (1 << 7)   /* Must be set for valid segments */
+
+

 typedef struct
 {


now when you try to set an existing key binding, it tells you the name of the action associated with the binding

git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@24234 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/bin/e_int_config_keybindings.c
+++ src/bin/e_int_config_keybindings.c
@@ -1362,6 +1362,8 @@
 	  {
 	     if (cfdata && cfdata->current_act && cfdata->current_act_selector >= 0)
 	       {
+                  ACTION_GROUP *actg;
+                  ACTION2 *act;
 		  Evas_List   *l, *l2, *l3;
 		  int found;
 		  int mod = E_BINDING_MODIFIER_NONE;
@@ -1378,10 +1380,10 @@
 		  found = 0;
 		  for (l = action_group_list; l && !found; l = l->next)
 		    {
-		       ACTION_GROUP *actg = l->data;
+                       actg = l->data;
 		       for (l2 = actg->actions; l2 && !found; l2 = l2->next)
 			 {
-			    ACTION2 *act = l2->data;
+                            act = l2->data;
 			    for (l3 = act->key_bindings; l3 && !found; l3 = l3->next)
 			      {
 				 eb = l3->data;
@@ -1402,10 +1404,18 @@
 		       _e_keybinding_update_binding_list(cfdata);
 		    }
 		  else
-		    e_util_dialog_show(_("Binding Key Error"),
-				       _("The binding key sequence, that you choose,"
-					 " is already used.
Please choose another binding key"
-					 " sequence."));
+                    {
+                       char buf[4096];
+
+                       snprintf(buf, sizeof(buf),
+                                _("The binding key sequence, that you choose,"
+                                  " is already used by
"
+                                  "<hilight>%s</hilight> action.
"
+                                  "Please choose another binding key"
+                                  " sequence."),
+                                act->action_name);
+                       e_util_dialog_show(_("Binding Key Error"), buf);
+                    }

 	       }
 	       _e_keybinding_keybind_shortcut_wnd_hide(cfdata);


virsh: fix IP address in vncdisplay for listen type='network'

Just like the fix for domdisplay in commit 1ba815.

--- tools/virsh-domain.c
+++ tools/virsh-domain.c
@@ -10269,6 +10269,18 @@

     listen_addr = virXPathString("string(/domain/devices/graphics"
                                  "[@type='vnc']/@listen)", ctxt);
+    if (!listen_addr) {
+        /* The subelement address - <listen address='xyz'/> -
+         * *should* have been automatically backfilled into its
+         * parent <graphics listen='xyz'> (which we just tried to
+         * retrieve into listen_addr above) but in some cases it
+         * isn't, so we also do an explicit check for the
+         * subelement (which, by the way, doesn't exist on libvirt
+         * < 0.9.4, so we really do need to check both places)
+         */
+        listen_addr = virXPathString("string(/domain/devices/graphics"
+                                     "[@type='vnc']/listen/@address)", ctxt);
+    }
     if (listen_addr == NULL || STREQ(listen_addr, "0.0.0.0"))
         vshPrint(ctl, ":%d\n", port-5900);
     else


[debug][ramfs] Add a nice debug option for tracking the creation of inodes

--- kernel/fs/ramfs/inodes.c.h
+++ kernel/fs/ramfs/inodes.c.h
@@ -1,4 +1,6 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
+
+#define DEBUG_RAMFS_CREATE_INODE_PRINTK      0

 static ramfs_inode *ramfs_new_inode(ramfs_data *d)
 {
@@ -10,6 +12,11 @@
    i->type = VFS_NONE;
    rwlock_wp_init(&i->rwlock, true);
    i->ino = d->next_inode_num++;
+
+   if (DEBUG_RAMFS_CREATE_INODE_PRINTK) {
+      printk("[ramfs] Create inode with ref_count at %p\n", &i->ref_count);
+   }
+
    return i;
 }


[FIX] Compilation error in debug mode

[FIX] Compilation error in debug mode

--- kernel/src/evaluator_inl.h
+++ kernel/src/evaluator_inl.h
@@ -29,7 +29,7 @@
 fitness_t sum_of_errors_evaluator<T>::operator()(const T &prg)
 {
   assert(!this->dat_->classes());
-  assert(this->dat_->cbegin() != this->dat_->cend());
+  assert(this->dat_->begin() != this->dat_->end());

   const basic_reg_lambda_f<T, false> agent(prg);

@@ -66,7 +66,7 @@
 fitness_t sum_of_errors_evaluator<T>::fast(const T &prg)
 {
   assert(!this->dat_->classes());
-  assert(this->dat_->cbegin() != this->dat_->cend());
+  assert(this->dat_->begin() != this->dat_->end());

   const basic_reg_lambda_f<T, false> agent(prg);

@@ -97,7 +97,7 @@
 double sum_of_errors_evaluator<T>::accuracy(const T &prg) const
 {
   assert(!this->dat_->classes());
-  assert(this->dat_->cbegin() != this->dat_->cend());
+  assert(this->dat_->begin() != this->dat_->end());

   const auto f(lambdify(prg));

@@ -262,7 +262,7 @@
 double classification_evaluator<T>::accuracy(const T &prg) const
 {
   assert(this->dat_->classes());
-  assert(this->dat_->cbegin() != this->dat_->cend());
+  assert(this->dat_->begin() != this->dat_->end());

   const auto f(this->lambdify(prg));


ring-buffer: remove unnecessary cpu_relax

The loops in the ring buffer that use cpu_relax are not dependent on
other CPUs. They simply came across some padding in the ring buffer and
are skipping over them. It is a normal loop and does not require a
cpu_relax.

Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

--- kernel/trace/ring_buffer.c
+++ kernel/trace/ring_buffer.c
@@ -3132,10 +3132,8 @@
 		spin_unlock(&cpu_buffer->reader_lock);
 	local_irq_restore(flags);

-	if (event && event->type_len == RINGBUF_TYPE_PADDING) {
-		cpu_relax();
+	if (event && event->type_len == RINGBUF_TYPE_PADDING)
 		goto again;
-	}

 	return event;
 }
@@ -3160,10 +3158,8 @@
 	event = rb_iter_peek(iter, ts);
 	spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);

-	if (event && event->type_len == RINGBUF_TYPE_PADDING) {
-		cpu_relax();
+	if (event && event->type_len == RINGBUF_TYPE_PADDING)
 		goto again;
-	}

 	return event;
 }
@@ -3209,10 +3205,8 @@
  out:
 	preempt_enable();

-	if (event && event->type_len == RINGBUF_TYPE_PADDING) {
-		cpu_relax();
+	if (event && event->type_len == RINGBUF_TYPE_PADDING)
 		goto again;
-	}

 	return event;
 }
@@ -3302,10 +3296,8 @@
  out:
 	spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);

-	if (event && event->type_len == RINGBUF_TYPE_PADDING) {
-		cpu_relax();
+	if (event && event->type_len == RINGBUF_TYPE_PADDING)
 		goto again;
-	}

 	return event;
 }


tools: Fix sign comparisons and check fread/fwrite

--- tools/yuv2yuv4mpeg.c
+++ tools/yuv2yuv4mpeg.c
@@ -4,6 +4,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#include "../src/odintrin.h"
+
+/*Helper macro to validate fwrite/fread operations*/
+#define CHECK_IO(func,ptr,size,nmemb,stream) \
+  if(func(ptr,size,nmemb,stream)<(size_t)nmemb){ \
+    fprintf(stderr,#func"() error\n"); \
+    return 1; \
+  }

 /*This is a small utility used to convert many of the standard test sequences
    into a common format, the YUV4MPEG format used by mjpegtools.
@@ -185,8 +194,8 @@
     return -1;
   }
   have_alpha=strstr(chroma,"alpha")!=NULL;
-  if(frame_digits<0)frame_digits=0;
-  if(strlen(_argv[1])>8178-frame_digits){
+  frame_digits = OD_CLAMPI(0,frame_digits,8178);
+  if(strlen(_argv[1])>(size_t)8178-frame_digits){
     fprintf(stderr,"File name too long.\n");
     return -1;
   }
@@ -252,18 +261,19 @@
   fprintf(out_y4m,"\n");
   buf=(unsigned char *)malloc((size_t)(y_w*y_h));
   for(;;){
-    if(fread(buf,y_w,y_h,in_y)<y_h)break;
+    if(fread(buf,y_w,y_h,in_y)<(size_t)y_h)break;
     fprintf(out_y4m,"FRAME\n");
-    fwrite(buf,y_w,y_h,out_y4m);
+    CHECK_IO(fwrite,buf,y_w,y_h,out_y4m);
+
     if(have_chroma){
-      fread(buf,c_w,c_h,in_u);
-      fwrite(buf,c_w,c_h,out_y4m);
-      fread(buf,c_w,c_h,in_v);
-      fwrite(buf,c_w,c_h,out_y4m);
+      CHECK_IO(fread,buf,c_w,c_h,in_u);
+      CHECK_IO(fwrite,buf,c_w,c_h,out_y4m);
+      CHECK_IO(fread,buf,c_w,c_h,in_v);
+      CHECK_IO(fwrite,buf,c_w,c_h,out_y4m);
     }
     if(have_alpha){
-      fread(buf,y_w,y_h,in_a);
-      fwrite(buf,y_w,y_h,out_y4m);
+      CHECK_IO(fread,buf,y_w,y_h,in_a);
+      CHECK_IO(fwrite,buf,y_w,y_h,out_y4m);
     }
     if(frame_digits>0){
       frame_num++;


tracing: remove recursive test from ring_buffer_event_discard

The ring_buffer_event_discard is not tied to ring_buffer_lock_reserve.
It can be called inside or outside the reserve/commit. Even if it
is called inside the reserve/commit the commit part must also be called.

Only ring_buffer_discard_commit can be used as a replacement for
ring_buffer_unlock_commit.

This patch removes the trace_recursive_unlock from ring_buffer_event_discard
since it would be the wrong place to do so.

[Impact: prevent breakage in trace recursive testing ]

Cc: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

--- kernel/trace/ring_buffer.c
+++ kernel/trace/ring_buffer.c
@@ -1667,7 +1667,6 @@
 void ring_buffer_event_discard(struct ring_buffer_event *event)
 {
 	rb_event_discard(event);
-	trace_recursive_unlock();
 }
 EXPORT_SYMBOL_GPL(ring_buffer_event_discard);


fixed syntax error in TestData Model

fixed syntax error in TestData Model

--- IoTSolution/app/simplesample_http.c
+++ IoTSolution/app/simplesample_http.c
@@ -61,7 +61,7 @@
               WITH_DATA(ascii_char_ptr_no_quotes, Commands),*/

               /* commands, triggered by exteranl*/
-              WITH_ACTION(TurnBuzzerO),
+              WITH_ACTION(TurnBuzzerOn),
               WITH_ACTION(TurnBuzzerOff),
               WITH_ACTION(UpdateFirmware, ascii_char_ptr, url, ascii_char_ptr, version)
               /*WITH_METHOD(UpdateFirmware_Method)*/


Updated file header

Updated file header

--- hecmw1/src/common/hecmw_dist_refine.c
+++ hecmw1/src/common/hecmw_dist_refine.c
@@ -3,10 +3,10 @@
  *   Software Name : HEC-MW Library for PC-cluster                     *
  *         Version : 2.5                                               *
  *                                                                     *
- *     Last Update : 2009/02/16                                        *
+ *     Last Update : 2013/12/13                                        *
  *        Category : I/O and Utility                                   *
  *                                                                     *
- *            Written by GOTO, Kazuya (AdvanceSoft)                    *
+ *            Written by GOTO, Kazuya (PExProCS)                       *
  *                                                                     *
  *     Contact address :  IIS,The University of Tokyo RSS21 project    *
  *                                                                     *


staging: comedi: addi_common: remove subdevice pointer math

Convert the comedi_subdevice access from pointer math to array
access.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/addi-data/addi_common.c
+++ drivers/staging/comedi/drivers/addi-data/addi_common.c
@@ -1669,7 +1669,7 @@
 			return ret;

 		/*  Allocate and Initialise AI Subdevice Structures */
-		s = dev->subdevices + 0;
+		s = &dev->subdevices[0];
 		if ((devpriv->s_EeParameters.i_NbrAiChannel)
 			|| (this_board->i_NbrAiChannelDiff)) {
 			dev->read_subdev = s;
@@ -1705,7 +1705,7 @@
 		}

 		/*  Allocate and Initialise AO Subdevice Structures */
-		s = dev->subdevices + 1;
+		s = &dev->subdevices[1];
 		if (devpriv->s_EeParameters.i_NbrAoChannel) {
 			s->type = COMEDI_SUBD_AO;
 			s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
@@ -1720,7 +1720,7 @@
 			s->type = COMEDI_SUBD_UNUSED;
 		}
 		/*  Allocate and Initialise DI Subdevice Structures */
-		s = dev->subdevices + 2;
+		s = &dev->subdevices[2];
 		if (devpriv->s_EeParameters.i_NbrDiChannel) {
 			s->type = COMEDI_SUBD_DI;
 			s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
@@ -1738,7 +1738,7 @@
 			s->type = COMEDI_SUBD_UNUSED;
 		}
 		/*  Allocate and Initialise DO Subdevice Structures */
-		s = dev->subdevices + 3;
+		s = &dev->subdevices[3];
 		if (devpriv->s_EeParameters.i_NbrDoChannel) {
 			s->type = COMEDI_SUBD_DO;
 			s->subdev_flags =
@@ -1760,7 +1760,7 @@
 		}

 		/*  Allocate and Initialise Timer Subdevice Structures */
-		s = dev->subdevices + 4;
+		s = &dev->subdevices[4];
 		if (devpriv->s_EeParameters.i_Timer) {
 			s->type = COMEDI_SUBD_TIMER;
 			s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
@@ -1778,7 +1778,7 @@
 		}

 		/*  Allocate and Initialise TTL */
-		s = dev->subdevices + 5;
+		s = &dev->subdevices[5];
 		if (this_board->i_NbrTTLChannel) {
 			s->type = COMEDI_SUBD_TTLIO;
 			s->subdev_flags =
@@ -1797,7 +1797,7 @@
 		}

 		/* EEPROM */
-		s = dev->subdevices + 6;
+		s = &dev->subdevices[6];
 		if (this_board->i_PCIEeprom) {
 			s->type = COMEDI_SUBD_MEMORY;
 			s->subdev_flags = SDF_READABLE | SDF_INTERNAL;


staging: comedi: addi_eeprom: cleanup v_EepromCs76Read()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_read_93c76().

Change the return type of the function to unsigned short and just
return the read value instead of passing it through a pointer.

Rename the CamelCase parameters and local variables.

Make addi_eeprom_cmd_93c76() return the last value so it does not
need to be calculated.

Rename the EE_READ and EE76_CMD_LEN defines so they have namespace
associated with the other 93c76 defines.

Cleanup the loop that reads the eeprom bits so it's a bit more concise.

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

--- drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
+++ drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
@@ -53,8 +53,8 @@
 #define EE93C76_CS_BIT		(1 << 1)
 #define EE93C76_DOUT_BIT	(1 << 2)
 #define EE93C76_DIN_BIT		(1 << 3)
-#define EE76_CMD_LEN    	13	/*  bits in instructions */
-#define EE_READ         	0x0180	/*  01 1000 0000 read instruction */
+#define EE93C76_READ_CMD	(0x0180 << 4)
+#define EE93C76_CMD_LEN		13

 #define EEPROM_DIGITALINPUT 			0
 #define EEPROM_DIGITALOUTPUT			1
@@ -121,9 +121,9 @@
 	udelay(100);
 }

-static void addi_eeprom_cmd_93c76(unsigned long iobase,
-				  unsigned int cmd,
-				  unsigned char len)
+static unsigned int addi_eeprom_cmd_93c76(unsigned long iobase,
+					  unsigned int cmd,
+					  unsigned char len)
 {
 	unsigned int val = EE93C76_CS_BIT;
 	int i;
@@ -145,50 +145,38 @@

 		addi_eeprom_clk_93c76(iobase, val);
 	}
-}
-
-static void v_EepromCs76Read(unsigned long iobase,
-			     unsigned short w_offset,
-			     unsigned short *pw_Value)
-{
-        char c_BitPos = 0;
-	unsigned int dw_RegisterValue = 0;
-	unsigned int dw_RegisterValueRead = 0;
+	return val;
+}
+
+static unsigned short addi_eeprom_readw_93c76(unsigned long iobase,
+					      unsigned short addr)
+{
+	unsigned short val = 0;
+	unsigned int cmd;
+	unsigned int tmp;
+        int i;

 	/* Send EEPROM read command and offset to EEPROM */
-	addi_eeprom_cmd_93c76(iobase, (EE_READ << 4) | (w_offset / 2),
-		EE76_CMD_LEN);
-
-	/* Get the last register value */
-	dw_RegisterValue = (((w_offset / 2) & 0x1) << 2) | EE93C76_CS_BIT;
-
-	/* Set the 16-bit value of 0 */
-	*pw_Value = 0;
+	cmd = EE93C76_READ_CMD | (addr / 2);
+	cmd = addi_eeprom_cmd_93c76(iobase, cmd, EE93C76_CMD_LEN);

 	/* Get the 16-bit value */
-	for (c_BitPos = 0; c_BitPos < 16; c_BitPos++) {
-		addi_eeprom_clk_93c76(iobase, dw_RegisterValue);
-
-		/* Get the result bit */
-		dw_RegisterValueRead = inl(iobase);
+	for (i = 0; i < 16; i++) {
+		addi_eeprom_clk_93c76(iobase, cmd);
+
+		tmp = inl(iobase);
 		udelay(100);

-		/* Get bit value and shift into result */
-		if (dw_RegisterValueRead & EE93C76_DIN_BIT) {
-			/* Read 1 */
-			*pw_Value = (*pw_Value << 1) | 0x1;
-		} else {
-			/* Read 0 */
-			*pw_Value = (*pw_Value << 1);
-		}
-	}
-
-	/* Clear all EEPROM bits */
-	dw_RegisterValue = 0x0;
+		val <<= 1;
+		if (tmp & EE93C76_DIN_BIT)
+			val |= 0x1;
+	}

 	/* Toggle EEPROM's Chip select to get it out of Shift Register Mode */
-	outl(dw_RegisterValue, iobase);
+	outl(0, iobase);
 	udelay(100);
+
+	return val;
 }

 static void v_EepromWaitBusy(unsigned long iobase)
@@ -270,10 +258,8 @@
 		w_ReadWord = (b_ReadLowByte | (((unsigned short) b_ReadHighByte) * 256));
 	}

-	if (!strcmp(type, "93C76")) {
-		/* Read 16 bit from the EEPROM 93C76 */
-		v_EepromCs76Read(iobase, w_EepromStartAddress, &w_ReadWord);
-	}
+	if (!strcmp(type, "93C76"))
+		w_ReadWord = addi_eeprom_readw_93c76(iobase, w_EepromStartAddress);

 	return w_ReadWord;
 }


staging: comedi: addi_eeprom: reformat driver comment

Reformat the driver description comment to use the preferred block
comment style.

The second driver comment block contains the same information as
the first one. Remove it.

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

--- drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
+++ drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
@@ -1,49 +1,33 @@
-/**
-@verbatim
-
-Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
-
-	ADDI-DATA GmbH
-	Dieselstrasse 3
-	D-77833 Ottersweier
-	Tel: +19(0)7223/9493-0
-	Fax: +49(0)7223/9493-92
-	http://www.addi-data.com
-	info@addi-data.com
-
-This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-You should also find the complete GPL in the COPYING file accompanying this source code.
-
-@endverbatim
-*/
 /*
-
-  +-----------------------------------------------------------------------+
-  | (C) ADDI-DATA GmbH          Dieselstrasse 3      D-77833 Ottersweier  |
-  +-----------------------------------------------------------------------+
-  | Tel : +49 (0) 7223/9493-0     | email    : info@addi-data.com         |
-  | Fax : +49 (0) 7223/9493-92    | Internet : http://www.addi-data.com   |
-  +-----------------------------------------------------------------------+
-  | Project   : ADDI DATA         | Compiler : GCC 			              |
-  | Modulname : addi_eeprom.c     | Version  : 2.96                       |
-  +-------------------------------+---------------------------------------+
-  | Project manager: Eric Stolz   | Date     :  02/12/2002                |
-  +-----------------------------------------------------------------------+
-  | Description : ADDI EEPROM  Module                                     |
-  +-----------------------------------------------------------------------+
-  |                             UPDATE'S                                  |
-  +-----------------------------------------------------------------------+
-  |   Date   |   Author  |          Description of updates                |
-  +----------+-----------+------------------------------------------------+
-  |          | 		 | 						  |
-  |          |           | 						  |
-  +----------+-----------+------------------------------------------------+
-*/
+ * addi_eeprom.c - ADDI EEPROM Module
+ * Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
+ * Project manager: Eric Stolz
+ *
+ *	ADDI-DATA GmbH
+ *	Dieselstrasse 3
+ *	D-77833 Ottersweier
+ *	Tel: +19(0)7223/9493-0
+ *	Fax: +49(0)7223/9493-92
+ *	http://www.addi-data.com
+ *	info@addi-data.com
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * You should also find the complete GPL in the COPYING file accompanying
+ * this source code.
+ */

 #define NVRAM_USER_DATA_START	0x100


Fix comment. Closes #1884.

Fix comment. Closes #1884.

--- Source/Urho3D/Graphics/Texture.h
+++ Source/Urho3D/Graphics/Texture.h
@@ -82,7 +82,7 @@
     /// Return height.
     int GetHeight() const { return height_; }

-    /// Return height.
+    /// Return depth.
     int GetDepth() const { return depth_; }

     /// Return filtering mode.


resizing-hbox: don't centre or scroll actors when depth_index is zero

--- mex/mex-resizing-hbox.c
+++ mex/mex-resizing-hbox.c
@@ -1279,7 +1279,7 @@

   /* calculate the starting offset to ensure the focused column is centered */
-  if (priv->current_focus)
+  if (priv->current_focus && priv->depth_index != 0)
     {
       gfloat cumulative_width = 0;


glm back to older version

glm back to older version

--- cegui/include/CEGUI/RendererModules/Ogre/GeometryBuffer.h
+++ cegui/include/CEGUI/RendererModules/Ogre/GeometryBuffer.h
@@ -37,8 +37,7 @@
 #include <OgreTexture.h>
 #include <OgreMatrix4.h>

-//#include <glm/core/type.hpp>
-#include <glm/common.hpp>
+#include <glm/core/type.hpp>

 #include <utility>
 #include <vector>


[COVERITY 10906]

[COVERITY 10906]

Change-Id: I2e4d68eb09f048d9f1b822a0444ee6a6ae6133c1

--- Sources/ARDISCOVERY_Connection.c
+++ Sources/ARDISCOVERY_Connection.c
@@ -599,58 +599,15 @@
             nbTryToConnect++;
         }
         while ((nbTryToConnect <= ARDISCOVERY_RECONNECTION_NB_RETRY_MAX) && (error == ARDISCOVERY_ERROR_SOCKET_UNREACHABLE));
-
-        /*connectError = ARSAL_Socket_Connect (connectionData->socket, (struct sockaddr*) &(connectionData->address), sizeof (connectionData->address));
-
-        if (connectError != 0)
-        {
-            switch (errno)
-            {
-                case EINPROGRESS:
-                    break;
-                case EACCES:
-                    error = ARDISCOVERY_ERROR_SOCKET_PERMISSION_DENIED;
-                    break;
-                case ENETUNREACH:
-                case EHOSTUNREACH:
-                {
-                    // in that particular case, we retry a connection because the host may be not resolved after a very recent connection
-                    ARSAL_PRINT(ARSAL_PRINT_ERROR, ARDISCOVERY_CONNECTION_TAG, "connect() failed: %d %s => Try reconnecting after %d seconds", errno, strerror(errno), ARDISCOVERY_RECONNECTION_TIME_SEC);
-                    sleep(ARDISCOVERY_RECONNECTION_TIME_SEC);
-                    connectError = ARSAL_Socket_Connect (connectionData->socket, (struct sockaddr*) &(connectionData->address), sizeof (connectionData->address));
-                    if (connectError != 0)
-                    {
-                        switch (errno)
-                        {
-                            case EINPROGRESS:
-
-                                break;
-                            case EACCES:
-                                error = ARDISCOVERY_ERROR_SOCKET_PERMISSION_DENIED;
-                                break;
-
-                            default:
-                                error = ARDISCOVERY_ERROR;
-                                break;
-                        }
-                    }
-                    break;
-                }
-                default:
-                    error = ARDISCOVERY_ERROR;
-                    break;
-            }
-
-            if (error != ARDISCOVERY_OK)
-            {
-                ARSAL_PRINT(ARSAL_PRINT_ERROR, ARDISCOVERY_CONNECTION_TAG, "connect() failed: %d %s", errno, strerror(errno));
-            }
-        }*/
-
+
         /* set the socket non blocking */
         flags = fcntl(connectionData->socket, F_GETFL, 0);
-        fcntl(connectionData->socket, F_SETFL, flags & (~O_NONBLOCK));
-
+        if (flags < 0)
+            ARSAL_PRINT(ARSAL_PRINT_ERROR, ARDISCOVERY_CONNECTION_TAG, "fcntl() error: %d %s", errno, strerror(errno));
+        ret = fcntl(connectionData->socket, F_SETFL, flags & (~O_NONBLOCK));
+        if (ret < 0)
+            ARSAL_PRINT(ARSAL_PRINT_ERROR, ARDISCOVERY_CONNECTION_TAG, "fcntl() error: %d %s", errno, strerror(errno));
+
         /* Initialize set */
         FD_ZERO(&readSet);
         FD_ZERO(&writeSet);


Standard-conformat compound-operation, e.g. int += float

--- src/cc1/ops/expr_assign_compound.c
+++ src/cc1/ops/expr_assign_compound.c
@@ -30,8 +30,10 @@
 		type_ref *resolved = op_required_promotion(e->op, lvalue, e->rhs, &e->where, &tlhs, &trhs);

 		if(tlhs){
-			/* can't cast the lvalue - we must cast the rhs to the correct size  */
-			fold_insert_casts(lvalue->tree_type, &e->rhs, stab);
+			/* must cast the lvalue, then down cast once the operation is done
+			 * special handling for expr_kind(e->lhs, cast) is done in the gen-code
+			 */
+			fold_insert_casts(tlhs, &e->lhs, stab);

 		}else if(trhs){
 			fold_insert_casts(trhs, &e->rhs, stab);
@@ -50,9 +52,16 @@

 void gen_expr_assign_compound(expr *e)
 {
-	lea_expr(e->lhs);
+	const int is_upcast = expr_kind(e->lhs, cast);
+
+	/* int += float
+	 * lea int, cast up to float, add, cast down to int, store
+	 */
+	lea_expr(is_upcast ? expr_cast_child(e->lhs) : e->lhs);

 	if(e->assign_is_post){
+		UCC_ASSERT(!is_upcast, "can't do upcast for (%s)++", e->f_str());
+
 		out_dup();
 		out_deref();
 		out_flush_volatile();
@@ -68,9 +77,16 @@
 	gen_expr(e->rhs);

 	/* here's the delayed dereference */
-	out_swap(), out_deref(), out_swap();
+	out_swap();
+	out_deref();
+	if(is_upcast)
+		out_cast(e->lhs->tree_type);
+	out_swap();

 	out_op(e->op);
+
+	if(is_upcast) /* need to cast back down to store */
+		out_cast(e->tree_type);

 	out_store();


Never return more than maxPayloadLength in PMD mock

--- src/PerMessageDeflate.h
+++ src/PerMessageDeflate.h
@@ -58,7 +58,7 @@
 struct ZlibContext {};
 struct InflationStream {
     std::optional<std::string_view> inflate(ZlibContext *zlibContext, std::string_view compressed, size_t maxPayloadLength) {
-        return compressed;
+        return compressed.substr(0, std::min(maxPayloadLength, compressed.length()));
     }
 };
 struct DeflationStream {


Changed value of BTM_OOB_INCLUDED to TRUE

Merges https://github.com/espressif/esp-idf/pull/2206

--- components/bt/bluedroid/common/include/common/bt_target.h
+++ components/bt/bluedroid/common/include/common/bt_target.h
@@ -735,7 +735,7 @@

 /* Include Out-of-Band implementation for Simple Pairing */
 #ifndef BTM_OOB_INCLUDED
-#define BTM_OOB_INCLUDED                FALSE//TRUE
+#define BTM_OOB_INCLUDED                TRUE
 #endif

 /* TRUE to include Sniff Subrating */


Cleaning up API test main

Cleaning up API test main

--- examples/rf233/main.c
+++ examples/rf233/main.c
@@ -1,3 +1,9 @@
+/*
+ * Example rf233 send/receive application.
+ * Callback function is supplied by user
+ * and is called by rf233 interrupt handler.
+ */
+
 #include <firestorm.h>
 #include <gpio.h>
 #include <spi.h>
@@ -10,33 +16,30 @@
 #include "trx_access.h"
 #include "rf233.h"

+// Callback function supplied by user
 int callback(void*, int);

 int main() {
-  //               FCF   FCF  Seq# Addr1 Addr1  Addr2 Addr2 Pan1  Pan2  Payload
-  // char buf[10] = {0x61, 0xAA, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xdd};
   char buf[2] = { 0xde, 0xad };

   rf233_init(0xab, 0xbc, 0xcd);
   rf233_rx_data(callback);

-  /*while (1) {
+  while (1) {
     rf233_tx_data(0x00, buf, 2);
     delay_ms(10);
     rf233_sleep();
     delay_ms(1000);
     rf233_on();
     delay_ms(10000);
-  }*/
-  //while(1) {}
+  }
 }

 int callback(void* buffer, int buffer_len) {
 	printf("Rx callback!\n");
   uint8_t* bytes = (uint8_t*) buffer;
-  for (int i = 0; i < 15; i ++) {
+  for (int i = 0; i < buffer_len; i ++) {
     printf("  Byte %i = %02x\n", i, bytes[i]);
   }
-
   return 0;
 }


CTT: Add scale test, a folder with more than 1000 dynamic variables

--- examples/server_ctt.c
+++ examples/server_ctt.c
@@ -2,7 +2,7 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  *
  * Copyright 2019 (c) Kalycito Infotech Private Limited
- *
+ * Copyright 2019 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
  */

 #ifdef _MSC_VER
@@ -216,6 +216,7 @@
 #define ARRAYID 50002
 #define MATRIXID 50003
 #define DEPTHID 50004
+#define SCALETESTID 50005

     UA_ObjectAttributes object_attr = UA_ObjectAttributes_default;
     object_attr.description = UA_LOCALIZEDTEXT("en-US", "Demo");
@@ -243,6 +244,12 @@
     object_attr.displayName = UA_LOCALIZEDTEXT("en-US", "Matrix");
     UA_Server_addObjectNode(server, UA_NODEID_NUMERIC(1, MATRIXID), UA_NODEID_NUMERIC(1, DEMOID),
                             UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES), UA_QUALIFIEDNAME(1, "Matrix"),
+                            UA_NODEID_NUMERIC(0, UA_NS0ID_FOLDERTYPE), object_attr, NULL, NULL);
+
+    object_attr.description = UA_LOCALIZEDTEXT("en-US", "ScaleTest");
+    object_attr.displayName = UA_LOCALIZEDTEXT("en-US", "ScaleTest");
+    UA_Server_addObjectNode(server, UA_NODEID_NUMERIC(1, SCALETESTID), UA_NODEID_NUMERIC(1, DEMOID),
+                            UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES), UA_QUALIFIEDNAME(1, "ScaleTest"),
                             UA_NODEID_NUMERIC(0, UA_NS0ID_FOLDERTYPE), object_attr, NULL, NULL);

     /* Fill demo nodes for each type*/
@@ -352,6 +359,41 @@
                                 UA_NODEID_NUMERIC(0, UA_NS0ID_FOLDERTYPE), object_attr, NULL, NULL);
     }

+    /* Scale Test: 100 nodes of each type */
+    int scale_i = 0;
+    UA_UInt32 scale_nodeid = 53000;
+    for(UA_UInt32 type = 0; type < UA_TYPES_DIAGNOSTICINFO; type++) {
+        if(type == UA_TYPES_VARIANT || type == UA_TYPES_DIAGNOSTICINFO)
+            continue;
+
+        UA_VariableAttributes attr = UA_VariableAttributes_default;
+        attr.dataType = UA_TYPES[type].typeId;
+        attr.accessLevel = UA_ACCESSLEVELMASK_READ | UA_ACCESSLEVELMASK_WRITE;
+        attr.writeMask = UA_WRITEMASK_DISPLAYNAME | UA_WRITEMASK_DESCRIPTION;
+        attr.userWriteMask = UA_WRITEMASK_DISPLAYNAME | UA_WRITEMASK_DESCRIPTION;
+        attr.valueRank = UA_VALUERANK_SCALAR;
+        void *value = UA_new(&UA_TYPES[type]);
+        UA_Variant_setScalar(&attr.value, value, &UA_TYPES[type]);
+
+        for(size_t j = 0; j < 100; j++) {
+            char name[32];
+#ifndef UA_ENABLE_TYPENAMES
+            UA_snprintf(name, 20, "%02d - %i", type, scale_i);
+#else
+            UA_snprintf(name, 20, "%s - %i", UA_TYPES[type].typeName, scale_i);
+#endif
+            attr.displayName = UA_LOCALIZEDTEXT("en-US", name);
+            UA_QualifiedName qualifiedName = UA_QUALIFIEDNAME(1, name);
+            UA_Server_addVariableNode(server, UA_NODEID_NUMERIC(1, ++scale_nodeid),
+                                      UA_NODEID_NUMERIC(1, SCALETESTID),
+                                      UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
+                                      qualifiedName, baseDataVariableType, attr, NULL, NULL);
+            scale_i++;
+        }
+
+        UA_Variant_clear(&attr.value);
+    }
+
     /* Add the variable to some more places to get a node with three inverse references for the CTT */
     UA_ExpandedNodeId answer_nodeid = UA_EXPANDEDNODEID_STRING(1, "the.answer");
     UA_Server_addReference(server, UA_NODEID_NUMERIC(1, DEMOID),


ByteData: fix compatibility with final classes - get rid of nested method check

--- stingraykit/collection/ByteData.h
+++ stingraykit/collection/ByteData.h
@@ -105,17 +105,6 @@
 	template < typename T >
 	class BasicByteData;

-	namespace ByteArrayUtils
-	{
-
-		STINGRAYKIT_DECLARE_METHOD_CHECK(begin);
-		STINGRAYKIT_DECLARE_METHOD_CHECK(end);
-
-		template < typename T >
-		struct HasBeginEndMethods : integral_constant<bool, HasMethod_begin<T>::Value && HasMethod_end<T>::Value> { };
-
-	}
-
 	/**
 	 * @brief An object that retains shared ownership of an array of bytes
 	 */
@@ -173,8 +162,8 @@
 			: _data(make_shared_ptr<CollectionType>(data, data + size)), _offset(0), _sizeLimit(NoSizeLimit)
 		{ }

-		template < typename Range >
-		explicit BasicByteArray(const Range& range, typename EnableIf<ByteArrayUtils::HasBeginEndMethods<Range>::Value, Dummy>::ValueT* dummy = 0)
+		template < typename Range, decltype(std::declval<Range>().begin(), std::declval<Range>().end(), bool()) = false >
+		explicit BasicByteArray(const Range& range)
 			: _data(make_shared_ptr<CollectionType>(range.begin(), range.end())), _offset(0), _sizeLimit(NoSizeLimit)
 		{ }

@@ -228,8 +217,8 @@
 			_data->insert(_data->end(), first, last);
 		}

-		template < typename Range >
-		void append(const Range& range, typename EnableIf<ByteArrayUtils::HasBeginEndMethods<Range>::Value, Dummy>::ValueT* dummy = 0)
+		template < typename Range, decltype(std::declval<Range>().begin(), std::declval<Range>().end(), bool()) = false >
+		void append(const Range& range)
 		{ append(range.begin(), range.end()); }

 		template < typename U >


Make test_tiger clear color static

Make test_tiger clear color static

--- examples/test_tiger.c
+++ examples/test_tiger.c
@@ -36,7 +36,7 @@
 {
   int i;
   const VGfloat *style;
-  VGfloat clearColor[] = {1,1,1,1};
+  static VGfloat clearColor[] = {1,1,1,1};
   static int lastScissor = 0;

   if (animate) {


(partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6

Fix compiler warning:
eval/eval0eval.c: In function 'eval_notfound':
eval/eval0eval.c:371:14: error: variable 'arg2' set but not used [-Werror=unused-but-set-variable]

--- storage/innobase/eval/eval0eval.c
+++ storage/innobase/eval/eval0eval.c
@@ -368,13 +368,11 @@
 	func_node_t*	func_node)	/* in: function node */
 {
 	que_node_t*	arg1;
-	que_node_t*	arg2;
 	sym_node_t*	cursor;
 	sel_node_t*	sel_node;
 	ibool		ibool_val;

 	arg1 = func_node->args;
-	arg2 = que_node_get_next(arg1);

 	ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);


Verify that we have "folder" meta value in bookmark edit dialog

--- midori/midori-browser.c
+++ midori/midori-browser.c
@@ -855,7 +855,7 @@
                 const unsigned char* name = sqlite3_column_text (statement, 0);
                 gtk_list_store_insert_with_values (model, NULL, G_MAXINT,
                     0, name, 1, PANGO_ELLIPSIZE_END, -1);
-                if (!new_bookmark
+                if (!new_bookmark && katze_item_get_meta_string (bookmark, "folder")
                     && g_str_equal (katze_item_get_meta_string (bookmark, "folder"), name))
                     gtk_combo_box_set_active (GTK_COMBO_BOX (combo_folder), n);
                 n++;


Add new algorithm for_each_adjacent_pair

svn path=/branches/kdepim/enterprise4/kdepim/; revision=821361

--- kleopatra/utils/stl_util.h
+++ kleopatra/utils/stl_util.h
@@ -109,6 +109,20 @@
 	    else
 		return false;
 	return true;
+    }
+
+    template <typename InputIterator, typename BinaryOperation>
+    BinaryOperation for_each_adjacent_pair( InputIterator first, InputIterator last, BinaryOperation op ) {
+        typedef typename std::iterator_traits<InputIterator>::value_type ValueType;
+        if ( first == last )
+            return op;
+        ValueType value = *first;
+        while ( ++first != last ) {
+            ValueType tmp = *first;
+            op( value, tmp );
+            value = tmp;
+        }
+        return op;
     }

     //@{
@@ -252,6 +266,11 @@
         return all( boost::begin( c ), boost::end( c ), p );
     }

+    template <typename C, typename B>
+    B for_each_adjacent_pair( const C & c, B b ) {
+        return for_each_adjacent_pair( boost::begin( c ), boost::end( c ), b );
+    }
+
 }

 #endif /* __KDTOOLSCORE_STL_UTIL_H__ */


Be sure not to crash if "homepage" is NULL and hide homepage button

--- midori/midori-browser.c
+++ midori/midori-browser.c
@@ -3070,21 +3070,31 @@
         {
             GtkWidget* popup = gtk_window_new (GTK_WINDOW_POPUP);
             GtkWidget* box = gtk_toolbar_new ();
-            GtkToolItem* homepage = gtk_tool_button_new_from_stock (STOCK_HOMEPAGE);
+            gchar* homepage = NULL;
             guint i;
             KatzeItem* item;

             /* FIXME: Resize popup to avoid overflowing items */
             /* FIXME: Take care of added and removed items */
-            gtk_tool_item_set_is_important (homepage, TRUE);
-            gtk_widget_show (GTK_WIDGET (homepage));
-            g_signal_connect (homepage, "clicked",
-                G_CALLBACK (midori_browser_bookmark_homepage_clicked_cb), browser);
+            if (browser->settings)
+                g_object_get (browser->settings, "homepage", &homepage, NULL);
+            if (homepage && homepage)
+                {
+                    GtkToolItem* toolitem;
+
+                    toolitem = gtk_tool_button_new_from_stock (STOCK_HOMEPAGE);
+                    gtk_tool_item_set_is_important (toolitem, TRUE);
+                    gtk_widget_show (GTK_WIDGET (toolitem));
+                    g_signal_connect (toolitem, "clicked",
+                        G_CALLBACK (midori_browser_bookmark_homepage_clicked_cb),
+                        browser);
+                    gtk_toolbar_insert (GTK_TOOLBAR (box), toolitem, -1);
+                }
+
             gtk_container_add (GTK_CONTAINER (popup), box);
             gtk_window_set_transient_for (GTK_WINDOW (popup), GTK_WINDOW (browser));
             gtk_toolbar_set_icon_size (GTK_TOOLBAR (box), GTK_ICON_SIZE_MENU);
             gtk_toolbar_set_style (GTK_TOOLBAR (box), GTK_TOOLBAR_BOTH_HORIZ);
-            gtk_toolbar_insert (GTK_TOOLBAR (box), homepage, -1);
             i = 0;
             if (browser->bookmarks)
             while ((item = katze_array_get_nth_item (browser->bookmarks, i++)))
@@ -5403,7 +5413,8 @@
     #endif
     _action_set_active (browser, "Statusbar", browser->show_statusbar);

-    sokoke_widget_set_visible (GTK_WIDGET (browser->homepage), *homepage);
+    sokoke_widget_set_visible (GTK_WIDGET (browser->homepage),
+                               homepage && *homepage);

     g_free (homepage);
     g_free (toolbar_items);
@@ -5440,7 +5451,7 @@
         browser->progress_in_location = g_value_get_boolean (&value);
     else if (name == g_intern_string ("homepage"))
         sokoke_widget_set_visible (GTK_WIDGET (browser->homepage),
-            *g_value_get_string (&value));
+            g_value_get_string (&value) && *g_value_get_string (&value));
     else if (name == g_intern_string ("search-engines-in-completion"))
     {
         if (g_value_get_boolean (&value))


Switched variable order to save 1 byte

Switched variable order to save 1 byte


INTEGRATION: CWS changefileheader (1.3.378); FILE MERGED 2008/03/31 13:23:35 rt 1.3.378.1: #i87441# Change license header to LPGL v3.

--- sal/inc/osl/doublecheckedlocking.h
+++ sal/inc/osl/doublecheckedlocking.h
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: doublecheckedlocking.h,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.3 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: rt $ $Date: 2005-09-08 14:26:53 $
+ * $RCSfile: doublecheckedlocking.h,v $
+ * $Revision: 1.4 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/


[STM32] SPI - fix usage of unitialized variable

When doing an 8-byte SPI transfer the high byte of the uint16_t return
variable was never initialized and could return to the caller whatever
was on the stack. This initializes the variable before doing the SPI
transfer.

--- hw/mcu/stm/stm32_common/src/hal_spi.c
+++ hw/mcu/stm/stm32_common/src/hal_spi.c
@@ -926,6 +926,7 @@
     }
     __HAL_DISABLE_INTERRUPTS(sr);
     spi_stat.tx++;
+    retval = 0;
     rc = HAL_SPI_TransmitReceive(&spi->handle,(uint8_t *)&val,
                                  (uint8_t *)&retval, len,
                                  STM32_HAL_SPI_TIMEOUT);


added BrokenLink highlighting state

added BrokenLink highlighting state

--- markdownhighlighter.h
+++ markdownhighlighter.h
@@ -63,6 +63,7 @@
         InlineCodeBlock,
         MaskedSyntax,
         CurrentLineBackgroundColor,
+        BrokenLink,

         // internal
         CodeBlockEnd = 100,
@@ -120,7 +121,6 @@

     void reHighlightDirtyBlocks();

-private:
     QVector<HighlightingRule> _highlightingRulesPre;
     QVector<HighlightingRule> _highlightingRulesAfter;
     QVector<QTextBlock> _dirtyTextBlocks;


minor: oops wrong nesting for ifdefs

minor: oops wrong nesting for ifdefs

--- pymongo/time_helpers.h
+++ pymongo/time_helpers.h
@@ -29,9 +29,10 @@
 #define GMTIME_INVERSE(time_struct) _mkgmtime64(time_struct)
 #else
 #define GMTIME_INVERSE(time_struct) mkgmtime((time_struct))
+#endif
 #define GMTIME(timeinfo, seconds) gmtime_s((timeinfo), (seconds))
 #define LOCALTIME(timeinfo, seconds) localtime_s((timeinfo), (seconds))
-#endif
+#else
 #define GMTIME_INVERSE(time_struct) timegm((time_struct))
 #define GMTIME(timeinfo, seconds) gmtime_r((seconds), (timeinfo)), 0
 #define LOCALTIME(timeinfo, seconds) localtime_r((seconds), (timeinfo)), 0


Minor fix to Image_alpha

Minor fix to Image_alpha


In Image_store_pixels, ensure image is DirectClass before calling GetImagePixels/SyncImage.

--- ext/RMagick/rmimage.c
+++ ext/RMagick/rmimage.c
@@ -1,4 +1,4 @@
-/* $Id: rmimage.c,v 1.266 2007/12/20 22:34:24 rmagick Exp $ */
+/* $Id: rmimage.c,v 1.267 2007/12/21 15:53:07 rmagick Exp $ */
 /*============================================================================\
 |                Copyright (C) 2007 by Timothy P. Hunter
 | Name:     rmimage.c
@@ -5725,9 +5725,6 @@
 {
     Image *image;

-#if defined(HAVE_TYPE_ALPHACHANNELTYPE) || defined(HAVE_SETIMAGEALPHACHANNEL)
-    rb_warning("Magick::Image#matte is deprecated and may not be available in future releases of RMagick.");
-#endif
     image = rm_check_destroyed(self);
     return image->matte ? Qtrue : Qfalse;
 }
@@ -5744,7 +5741,6 @@
 #if defined(HAVE_TYPE_ALPHACHANNELTYPE) || defined(HAVE_SETIMAGEALPHACHANNEL)
     VALUE alpha_channel_type;

-    rb_warning("Magick::Image#matte= is deprecated. Use Magick::Image#alpha= instead.");
     if (RTEST(matte))
     {
         alpha_channel_type = rb_const_get(Module_Magick, rb_intern("ActivateAlphaChannel"));
@@ -8567,11 +8563,18 @@
     size = (long)(cols * rows);
     rm_check_ary_len(new_pixels, size);

-    (void) SetImageType(image, TrueColorType);
+    okay = SetImageStorageClass(image, DirectClass);
+    rm_check_image_exception(image, RetainOnError);
+    if (!okay)
+    {
+        rb_raise(Class_ImageMagickError, "SetImageStorageClass failed. Can't store pixels.");
+    }

     // Get a pointer to the pixels. Replace the values with the PixelPackets
     // from the pixels argument.
     pixels = GetImagePixels(image, x, y, cols, rows);
+    rm_check_image_exception(image, RetainOnError);
+
     if (pixels)
     {
         for (n = 0; n < size; n++)
@@ -8582,9 +8585,10 @@
         }

         okay = SyncImagePixels(image);
+        rm_check_image_exception(image, RetainOnError);
         if (!okay)
         {
-            rb_raise(Class_ImageMagickError, "image pixels could not be synced");
+            rb_raise(Class_ImageMagickError, "SyncImagePixels failed. Can't store pixels.");
         }
     }

@@ -8601,6 +8605,7 @@
 {
     Image *image = rm_check_frozen_image(self);
     (void) StripImage(image);
+    rm_check_image_exception(image, RetainOnError);
     return self;
 }

@@ -8640,8 +8645,9 @@
 {
 #if defined(HAVE_SYNCIMAGEPROFILES)
     Image *image = rm_check_destroyed(self);
-    return SyncImageProfiles(image) ? Qtrue : Qfalse;
-
+    volatile VALUE okay =  SyncImageProfiles(image) ? Qtrue : Qfalse;
+    rm_check_image_exception(image, RetainOnError);
+    return okay;
 #else
     self = self;
     rm_not_implemented();


In Image_spaceship, remove Ruby 1.6 behavior

--- ext/RMagick/rmimage.c
+++ ext/RMagick/rmimage.c
@@ -1,4 +1,4 @@
-/* $Id: rmimage.c,v 1.254 2007/09/23 20:42:00 rmagick Exp $ */
+/* $Id: rmimage.c,v 1.255 2007/09/23 20:47:42 rmagick Exp $ */
 /*============================================================================\
 |                Copyright (C) 2007 by Timothy P. Hunter
 | Name:     rmimage.c
@@ -8538,15 +8538,7 @@
     // If the other object isn't a Image object, then they can't be equal.
     if (!rb_obj_is_kind_of(other, Class_Image))
     {
-#if RUBY_VERSION < 0x180
-        // In 1.6, raise TypeError
-        rb_raise(rb_eTypeError, "%s compared with %s",
-                                rb_class2name(CLASS_OF(self)),
-                                rb_class2name(CLASS_OF(other)));
-#else
-        // In 1.8, return nil
         return Qnil;
-#endif
     }

     rm_check_destroyed(other);


flacdec: small cleanups

flacdec: small cleanups

Remove some callback indirections which are no longer needed because
there's only one decoder object type now. Also remove unused variable.

--- ext/flac/gstflacdec.c
+++ ext/flac/gstflacdec.c
@@ -39,6 +39,8 @@
  */

 /* TODO: add seeking when operating chain-based with unframed input */
+/* FIXME: merge dec->seekable_decoder and dec->stream_decoder now that they're
+ * the same type */

 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -142,9 +144,9 @@
 gst_flac_dec_write_stream (const FLAC__StreamDecoder * decoder,
     const FLAC__Frame * frame,
     const FLAC__int32 * const buffer[], void *client_data);
-static void gst_flac_dec_metadata_callback_stream (const FLAC__StreamDecoder *
+static void gst_flac_dec_metadata_cb (const FLAC__StreamDecoder *
     decoder, const FLAC__StreamMetadata * metadata, void *client_data);
-static void gst_flac_dec_error_callback_stream (const FLAC__StreamDecoder *
+static void gst_flac_dec_error_cb (const FLAC__StreamDecoder *
     decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);

 GST_BOILERPLATE (GstFlacDec, gst_flac_dec, GstElement, GST_TYPE_ELEMENT);
@@ -152,12 +154,6 @@
 /* FIXME 0.11: Use width=32 for all depths and let audioconvert
  * handle the conversions instead of doing it ourself.
  */
-static const GstElementDetails vorbis_dec_details =
-GST_ELEMENT_DETAILS ("Vorbis audio decoder",
-    "Codec/Decoder/Audio",
-    "decode raw vorbis streams to float audio",
-    "Benjamin Otte <in7y118@public.uni-hamburg.de>");
-
 #define GST_FLAC_DEC_SRC_CAPS                             \
     "audio/x-raw-int, "                                   \
     "endianness = (int) BYTE_ORDER, "                     \
@@ -576,9 +572,13 @@
 }

 static void
-gst_flac_dec_metadata_callback (GstFlacDec * flacdec,
-    const FLAC__StreamMetadata * metadata)
-{
+gst_flac_dec_metadata_cb (const FLAC__StreamDecoder * decoder,
+    const FLAC__StreamMetadata * metadata, void *client_data)
+{
+  GstFlacDec *flacdec = GST_FLAC_DEC (client_data);
+
+  GST_LOG_OBJECT (flacdec, "metadata type: %d", metadata->type);
+
   switch (metadata->type) {
     case FLAC__METADATA_TYPE_STREAMINFO:{
       gint64 samples;
@@ -634,19 +634,13 @@
 }

 static void
-gst_flac_dec_metadata_callback_stream (const FLAC__StreamDecoder * decoder,
-    const FLAC__StreamMetadata * metadata, void *client_data)
-{
-  GstFlacDec *dec = GST_FLAC_DEC (client_data);
-
-  gst_flac_dec_metadata_callback (dec, metadata);
-}
-
-static void
-gst_flac_dec_error_callback (GstFlacDec * dec,
-    FLAC__StreamDecoderErrorStatus status)
+gst_flac_dec_error_cb (const FLAC__StreamDecoder * d,
+    FLAC__StreamDecoderErrorStatus status, void *client_data)
 {
   const gchar *error;
+  GstFlacDec *dec;
+
+  dec = GST_FLAC_DEC (client_data);

   switch (status) {
     case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
@@ -665,13 +659,6 @@

   GST_ELEMENT_ERROR (dec, STREAM, DECODE, (NULL), ("%s (%d)", error, status));
   dec->last_flow = GST_FLOW_ERROR;
-}
-
-static void
-gst_flac_dec_error_callback_stream (const FLAC__StreamDecoder * d,
-    FLAC__StreamDecoderErrorStatus status, void *client_data)
-{
-  gst_flac_dec_error_callback (GST_FLAC_DEC (client_data), status);
 }

 static FLAC__StreamDecoderSeekStatus
@@ -1079,8 +1066,7 @@
     is = FLAC__stream_decoder_init_stream (flacdec->seekable_decoder,
         gst_flac_dec_read_seekable, gst_flac_dec_seek, gst_flac_dec_tell,
         gst_flac_dec_length, gst_flac_dec_eof, gst_flac_dec_write_stream,
-        gst_flac_dec_metadata_callback_stream,
-        gst_flac_dec_error_callback_stream, flacdec);
+        gst_flac_dec_metadata_cb, gst_flac_dec_error_cb, flacdec);
     if (is != FLAC__STREAM_DECODER_INIT_STATUS_OK)
       goto analyze_state;

@@ -1307,8 +1293,8 @@
     GST_DEBUG_OBJECT (dec, "initializing decoder");
     s = FLAC__stream_decoder_init_stream (dec->stream_decoder,
         gst_flac_dec_read_stream, NULL, NULL, NULL, NULL,
-        gst_flac_dec_write_stream, gst_flac_dec_metadata_callback_stream,
-        gst_flac_dec_error_callback_stream, dec);
+        gst_flac_dec_write_stream, gst_flac_dec_metadata_cb,
+        gst_flac_dec_error_cb, dec);
     if (s != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
       GST_ELEMENT_ERROR (GST_ELEMENT (dec), LIBRARY, INIT, (NULL), (NULL));
       return GST_FLOW_ERROR;


jpegdec: free temporary buffer when changing state to NULL

Free temporary allocations in the state change function and not
only when the object is finalised.

--- ext/jpeg/gstjpegdec.c
+++ ext/jpeg/gstjpegdec.c
@@ -148,18 +148,11 @@
 gst_jpeg_dec_finalize (GObject * object)
 {
   GstJpegDec *dec = GST_JPEG_DEC (object);
-  gint i;

   jpeg_destroy_decompress (&dec->cinfo);

   if (dec->tempbuf)
     gst_buffer_unref (dec->tempbuf);
-
-  for (i = 0; i < 16; i++) {
-    g_free (dec->idr_y[i]);
-    g_free (dec->idr_u[i]);
-    g_free (dec->idr_v[i]);
-  }

   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -682,6 +675,23 @@
   }
 }

+static void
+gst_jpeg_dec_free_buffers (GstJpegDec * dec)
+{
+  gint i;
+
+  for (i = 0; i < 16; i++) {
+    g_free (dec->idr_y[i]);
+    g_free (dec->idr_u[i]);
+    g_free (dec->idr_v[i]);
+    dec->idr_y[i] = NULL;
+    dec->idr_u[i] = NULL;
+    dec->idr_v[i] = NULL;
+  }
+
+  dec->idr_width_allocated = 0;
+}
+
 static inline gboolean
 gst_jpeg_dec_ensure_buffers (GstJpegDec * dec, guint maxrowbytes)
 {
@@ -1430,6 +1440,7 @@
         gst_buffer_unref (dec->tempbuf);
         dec->tempbuf = NULL;
       }
+      gst_jpeg_dec_free_buffers (dec);
       break;
     default:
       break;


jpegenc: Fix for single-includes that are not in 1.0 yet

--- ext/jpeg/gstjpegenc.c
+++ ext/jpeg/gstjpegenc.c
@@ -41,7 +41,7 @@
 #include "gstjpeg.h"
 #include <gst/video/video.h>
 #include <gst/video/gstvideometa.h>
-#include <gst/base/base.h>
+#include <gst/base/gstbytereader.h>

 /* experimental */
 /* setting smoothig seems to have no effect in libjepeg


Fix #2521 by @scento

Fix #2521 by @scento

--- ext/mvc/model/query.c
+++ ext/mvc/model/query.c
@@ -1473,10 +1473,9 @@

 	zval *join_type, *join_source, *model_alias;
 	zval *join_alias, *relation, *fields = NULL, *referenced_fields = NULL;
-	zval *left = NULL, *left_expr = NULL, *right = NULL, *right_expr = NULL, *sql_join_condition;
-	zval *sql_join_conditions, *sql_join_partial_conditions;
+	zval *left = NULL, *left_expr = NULL, *right = NULL, *right_expr = NULL, *sql_join_condition = NULL;
+	zval *sql_join_conditions;
 	zval *field = NULL, *position = NULL, *exception_message = NULL;
-	zval *sql_equals_join_condition = NULL;
 	HashTable *ah0;
 	HashPosition hp0;
 	zval **hd;
@@ -1524,7 +1523,7 @@
 		/**
 		 * Create a binary operation for the join conditions
 		 */
-		PHALCON_INIT_VAR(sql_join_condition);
+		PHALCON_INIT_NVAR(sql_join_condition);
 		array_init_size(sql_join_condition, 4);
 		add_assoc_stringl_ex(sql_join_condition, ISS(type), SL("binary-op"), 1);
 		add_assoc_stringl_ex(sql_join_condition, ISS(op), SL("="), 1);
@@ -1536,10 +1535,10 @@
 		/**
 		 * Resolve the compound operation
 		 */
-		PHALCON_INIT_VAR(sql_join_partial_conditions);
+		PHALCON_INIT_VAR(sql_join_conditions);

 		phalcon_is_iterable(fields, &ah0, &hp0, 0, 0);
-		array_init_size(sql_join_partial_conditions, zend_hash_num_elements(ah0));
+		array_init_size(sql_join_conditions, zend_hash_num_elements(ah0));

 		while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
 			zval *referenced_field;
@@ -1581,13 +1580,13 @@
 			/**
 			 * Create a binary operation for the join conditions
 			 */
-			PHALCON_INIT_NVAR(sql_equals_join_condition);
-			array_init_size(sql_equals_join_condition, 4);
-			add_assoc_stringl_ex(sql_equals_join_condition, ISS(type), SL("binary-op"), 1);
-			add_assoc_stringl_ex(sql_equals_join_condition, ISS(op), SL("="), 1);
-			phalcon_array_update_string(&sql_equals_join_condition, ISL(left), left_expr, PH_COPY);
-			phalcon_array_update_string(&sql_equals_join_condition, ISL(right), right_expr, PH_COPY);
-			phalcon_array_append(&sql_join_partial_conditions, sql_equals_join_condition, 0);
+			PHALCON_INIT_NVAR(sql_join_condition);
+			array_init_size(sql_join_condition, 4);
+			add_assoc_stringl_ex(sql_join_condition, ISS(type), SL("binary-op"), 1);
+			add_assoc_stringl_ex(sql_join_condition, ISS(op), SL("="), 1);
+			phalcon_array_update_string(&sql_join_condition, ISL(left), left_expr, PH_COPY);
+			phalcon_array_update_string(&sql_join_condition, ISL(right), right_expr, PH_COPY);
+			phalcon_array_append(&sql_join_conditions, sql_join_condition, 0);

 			zend_hash_move_forward_ex(ah0, &hp0);
 		}