cell: fix typos in blend code-gen

cell: fix typos in blend code-gen

--- src/gallium/drivers/cell/ppu/cell_gen_fragment.c
+++ src/gallium/drivers/cell/ppu/cell_gen_fragment.c
@@ -286,16 +286,16 @@
          spe_roti(f, mask_reg, mask_reg, 8);

          /* fbG = fbRGBA & mask */
-         spe_and(f, fbB_reg, fbRGBA_reg, mask_reg);
+         spe_and(f, fbG_reg, fbRGBA_reg, mask_reg);
          /* fbG = fbG >> 8 */
-         spe_roti(f, fbB_reg, fbB_reg, -8);
+         spe_roti(f, fbG_reg, fbG_reg, -8);
          /* mask = mask << 8 */
          spe_roti(f, mask_reg, mask_reg, 8);

          /* fbR = fbRGBA & mask */
          spe_and(f, fbR_reg, fbRGBA_reg, mask_reg);
          /* fbR = fbR >> 16 */
-         spe_roti(f, fbB_reg, fbB_reg, -16);
+         spe_roti(f, fbR_reg, fbR_reg, -16);
          /* mask = mask << 8 */
          spe_roti(f, mask_reg, mask_reg, 8);


Fix session offline sync status getter

Fix session offline sync status getter

--- src/session.c
+++ src/session.c
@@ -19,8 +19,13 @@
   session->connectionstate = connectionstate;

   session->offline_time_left = offline_time_left;
-  session->offline_sync_status = ALLOC(sp_offline_sync_status);
-  MEMCPY(session->offline_sync_status, sync_status, sp_offline_sync_status);
+
+  if (sync_status)
+  {
+    session->offline_sync_status = ALLOC(sp_offline_sync_status);
+    MEMCPY(session->offline_sync_status, sync_status, sp_offline_sync_status);
+  }
+
   session->offline_num_playlists = offline_num_playlists;
   session->offline_tracks_to_sync = offline_tracks_to_sync;

@@ -212,8 +217,13 @@
 bool
 sp_offline_sync_get_status(sp_session *session, sp_offline_sync_status *status)
 {
-  MEMCPY(status, session->offline_sync_status, sp_offline_sync_status);
-  return true;
+  if (session->offline_sync_status)
+  {
+    MEMCPY(status, session->offline_sync_status, sp_offline_sync_status);
+    return true;
+  }
+
+  return false;
 }

 int sp_offline_time_left(sp_session *x) { return x->offline_time_left; }


* modules/stream_out/transcode.c: fixed segfault.

--- modules/stream_out/transcode.c
+++ modules/stream_out/transcode.c
@@ -2,7 +2,7 @@
  * transcode.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.67 2004/01/17 11:41:21 gbazin Exp $
+ * $Id: transcode.c,v 1.68 2004/01/17 12:11:58 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -1108,6 +1108,7 @@
     /* Close the encoder.
      * We'll open it only when we have the first frame */
     module_Unneed( id->p_encoder, id->p_encoder->p_module );
+    id->p_encoder->p_module = NULL;

     id->b_enc_inited = VLC_FALSE;

@@ -1125,7 +1126,8 @@
     }

     /* Close encoder */
-    module_Unneed( id->p_encoder, id->p_encoder->p_module );
+    if( id->p_encoder->p_module )
+        module_Unneed( id->p_encoder, id->p_encoder->p_module );
     vlc_object_destroy( id->p_encoder );

     /* Misc cleanup */


freedreno/a4xx: fix vpsrepl for blit shaders

Signed-off-by: Rob Clark <6f78cdb10adbe0a7fbbf4098125a51f401c77a5f@freedesktop.org>

--- src/gallium/drivers/freedreno/a4xx/fd4_program.c
+++ src/gallium/drivers/freedreno/a4xx/fd4_program.c
@@ -537,16 +537,25 @@

 /* hack.. until we figure out how to deal w/ vpsrepl properly.. */
 static void
-fix_blit_fp(struct pipe_context *pctx)
-{
-	struct fd_context *ctx = fd_context(pctx);
-	struct fd4_shader_stateobj *so = ctx->blit_prog[0].fp;
-
+fix_blit_fp(struct fd4_shader_stateobj *so)
+{
 	so->shader->vpsrepl[0] = 0x99999999;
 	so->shader->vpsrepl[1] = 0x99999999;
 	so->shader->vpsrepl[2] = 0x99999999;
 	so->shader->vpsrepl[3] = 0x99999999;
 }
+static void
+fix_blit_fps(struct pipe_context *pctx)
+{
+	struct fd_context *ctx = fd_context(pctx);
+	int i;
+
+	for (i = 0; i < ctx->screen->max_rts; i++)
+		fix_blit_fp(ctx->blit_prog[i].fp);
+
+	fix_blit_fp(ctx->blit_z.fp);
+	fix_blit_fp(ctx->blit_zs.fp);
+}

 void
 fd4_prog_init(struct pipe_context *pctx)
@@ -559,5 +568,5 @@

 	fd_prog_init(pctx);

-	fix_blit_fp(pctx);
-}
+	fix_blit_fps(pctx);
+}


build BUGFIX fix for openssl < 1.1.0

build BUGFIX fix for openssl < 1.1.0

--- src/session.c
+++ src/session.c
@@ -1375,7 +1375,9 @@
     return type;
 }

-#if defined(NC_ENABLED_SSH) && !defined(NC_ENABLED_TLS)
+#ifdef NC_ENABLED_SSH
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0

 static void
 nc_ssh_init(void)
@@ -1393,7 +1395,9 @@
     ssh_finalize();
 }

-#endif /* NC_ENABLED_SSH && !NC_ENABLED_TLS */
+#endif
+
+#endif /* NC_ENABLED_SSH */

 #ifdef NC_ENABLED_TLS

@@ -1584,7 +1588,7 @@
 {
 #if defined(NC_ENABLED_SSH) && defined(NC_ENABLED_TLS)
     nc_ssh_tls_init();
-#elif defined(NC_ENABLED_SSH)
+#elif defined(NC_ENABLED_SSH) && OPENSSL_VERSION_NUMBER < 0x10100000L
     nc_ssh_init();
 #elif defined(NC_ENABLED_TLS)
     nc_tls_init();
@@ -1596,7 +1600,7 @@
 {
 #if defined(NC_ENABLED_SSH) && defined(NC_ENABLED_TLS)
     nc_ssh_tls_destroy();
-#elif defined(NC_ENABLED_SSH)
+#elif defined(NC_ENABLED_SSH) && OPENSSL_VERSION_NUMBER < 0x10100000L
     nc_ssh_destroy();
 #elif defined(NC_ENABLED_TLS)
     nc_tls_destroy();


Properly cleanup afilters and vfilters on Close(). (Patch by Ikka Ollakka)

--- modules/stream_out/transcode.c
+++ modules/stream_out/transcode.c
@@ -798,6 +798,15 @@

     sout_StreamDelete( p_sys->p_out );

+    while( p_sys->i_afilters )
+    {
+        p_sys->i_afilters--;
+        if( p_sys->psz_afilters[p_sys->i_afilters] )
+            free( p_sys->psz_afilters[p_sys->i_afilters] );
+        if( p_sys->p_afilters_cfg[p_sys->i_afilters] )
+            free( p_sys->p_afilters_cfg[p_sys->i_afilters] );
+    }
+
     while( p_sys->p_audio_cfg != NULL )
     {
         config_chain_t *p_next = p_sys->p_audio_cfg->p_next;
@@ -811,6 +820,15 @@
         p_sys->p_audio_cfg = p_next;
     }
     if( p_sys->psz_aenc ) free( p_sys->psz_aenc );
+
+    while( p_sys->i_vfilters )
+    {
+        p_sys->i_vfilters--;
+        if( p_sys->psz_vfilters[p_sys->i_vfilters] )
+            free( p_sys->psz_vfilters[p_sys->i_vfilters] );
+        if( p_sys->p_vfilters_cfg[p_sys->i_vfilters] )
+            free( p_sys->p_vfilters_cfg[p_sys->i_vfilters] );
+    }

     while( p_sys->p_video_cfg != NULL )
     {


sub shm BUGFIX do not print false message

If there are at least "done" subscribers,
the data do have subscribers.

--- src/shm_sub.c
+++ src/shm_sub.c
@@ -728,8 +728,11 @@
         /* just find out whether there are any subscriptions and if so, what is the highest priority */
         if (!sr_shmsub_conf_notify_has_subscription(mod_info->conn->ext_shm.addr, mod, mod_info->ds, SR_SUB_EV_CHANGE,
                     &cur_priority)) {
-            SR_LOG_INF("There are no subscribers for changes of the module \"%s\" in %s DS.",
-                    mod->ly_mod->name, sr_ds2str(mod_info->ds));
+            if (!sr_shmsub_conf_notify_has_subscription(mod_info->conn->ext_shm.addr, mod, mod_info->ds, SR_SUB_EV_DONE,
+                    &cur_priority)) {
+                SR_LOG_INF("There are no subscribers for changes of the module \"%s\" in %s DS.",
+                        mod->ly_mod->name, sr_ds2str(mod_info->ds));
+            }
             continue;
         }


Update HBAstNumber.h

Update HBAstNumber.h

--- src/handlebars-objc/ast/expression/HBAstNumber.h
+++ src/handlebars-objc/ast/expression/HBAstNumber.h
@@ -31,7 +31,7 @@
 typedef struct HBParserIntegerValue HBParserIntegerValue;
 struct HBParserIntegerValue {
     int value;
-    NSString* source;
+    __unsafe_unretained NSString* source; //Get rid of 'Arc forbids' error
 };

 @interface HBAstNumber : HBAstValue


taking out original mmap to see if it's causing conflicts

--- sunfounder.c
+++ sunfounder.c
@@ -441,10 +441,10 @@

 int main(){
     printf("hello there main");
-    setupio();
+    //setupio();
     uint8_t rc = spi_setup_test();
     //uint8_t rc = screen_init();
-    led_heartbeat_setup();
+    //led_heartbeat_setup();
     if (rc) {
         return 1;
     }
@@ -453,7 +453,7 @@
     while(1){
         fillScreen(0x0000);
 	write_command(CMD_MEM_WRITE);
-        GPIO_CLR = 1<<21;
+     //   GPIO_CLR = 1<<21;
         //write_command(0x20);
 	printf("passing loop\n");
         while (i) {
@@ -462,7 +462,7 @@
         i = 100000000;
         fillScreen(0xFFFF);
 	write_command(CMD_MEM_WRITE);
-	GPIO_SET = 1<<21;
+	//GPIO_SET = 1<<21;
         //write_command(0x21);
         while (i) {
             i--;


Added 'graphical' (ASCII-graphics) power display

--- apps/shell/shell-sky.c
+++ apps/shell/shell-sky.c
@@ -28,7 +28,7 @@
  *
  * This file is part of the Contiki operating system.
  *
- * $Id: shell-sky.c,v 1.2 2008/02/24 20:34:05 adamdunkels Exp $
+ * $Id: shell-sky.c,v 1.3 2008/06/21 18:33:22 adamdunkels Exp $
  */

 /**
@@ -98,6 +98,11 @@
 	      "powerconv",
 	      "powerconv: convert power profile to human readable output",
 	      &shell_powerconv_process);
+PROCESS(shell_powergraph_process, "powergraph");
+SHELL_COMMAND(powergraph_command,
+	      "powergraph",
+	      "powergraph: convert power profile to a 'graphical' repressentation",
+	      &shell_powergraph_process);
 /*---------------------------------------------------------------------------*/
 #define MAX(a, b) ((a) > (b)? (a): (b))
 #define MIN(a, b) ((a) < (b)? (a): (b))
@@ -355,11 +360,68 @@
   PROCESS_END();
 }
 /*---------------------------------------------------------------------------*/
+#define MAX_POWERGRAPH 34
+static void
+printpowergraph(struct power_msg *msg)
+{
+  int i, j;
+  unsigned long avg_power;
+  unsigned long time;
+  char buf[MAX_POWERGRAPH];
+
+  time = msg->cpu + msg->lpm;
+
+  avg_power = (3L *
+	       (msg->cpu       * DEC2FIX(1L,800L) +
+		msg->lpm       * DEC2FIX(0L,545L) +
+		msg->transmit  * DEC2FIX(17L,700L) +
+		msg->listen    * DEC2FIX(20L,0))) / ((64L * time) / 1000);
+  memset(buf, 0, MAX_POWERGRAPH);
+  for(i = 0; avg_power > 0 && i < MAX_POWERGRAPH; ++i) {
+    buf[i] = '*';
+    avg_power -= MIN(2000, avg_power);
+  }
+  shell_output_str(&powergraph_command, buf, "");
+}
+/*---------------------------------------------------------------------------*/
+PROCESS_THREAD(shell_powergraph_process, ev, data)
+{
+  struct power_msg *msg;
+  struct shell_input *input;
+  int len;
+
+  PROCESS_BEGIN();
+  while(1) {
+    PROCESS_WAIT_EVENT_UNTIL(ev == shell_event_input);
+    input = data;
+
+    if(input->len1 + input->len2 == 0) {
+      PROCESS_EXIT();
+    }
+    len = input->len1;
+    for(msg = (struct power_msg *)input->data1;
+	len > 0;
+	msg++, len -= sizeof(struct power_msg)) {
+      printpowergraph(msg);
+    }
+    len = input->len2;
+    for(msg = (struct power_msg *)input->data2;
+	len > 0;
+	msg++, len -= sizeof(struct power_msg)) {
+      printpowergraph(msg);
+    }
+
+  }
+
+  PROCESS_END();
+}
+/*---------------------------------------------------------------------------*/
 void
 shell_sky_init(void)
 {
   shell_register_command(&power_command);
   shell_register_command(&powerconv_command);
+  shell_register_command(&powergraph_command);
   shell_register_command(&energy_command);
   shell_register_command(&txpower_command);
   shell_register_command(&rfchannel_command);


Keep current scrobble after executing a scrobble event

--- src/slastfm.h
+++ src/slastfm.h
@@ -482,7 +482,9 @@
                 _log(debug, "last.fm::scrobble_pos(%p//%i)", current, pos);
                 lastfm_scrobble(s->scrobbler, *current);
                 current->scrobbled = true;
-                scrobbles_remove(s, pos);
+                if (pos > 0) {
+                    scrobbles_remove(s, pos);
+                }
                 consumed++;
             } else {
                 _log(warning, "last.fm::invalid_scrobble:pos(%p//%i) %s//%s//%s", current, pos, current->title, current->artist, current->album);


Fix the handling of control characters when using scan codes. (st)

git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@950 91a5dbb7-01b9-0310-9b5f-b28072856b6e

--- Programs/scr_linux.c
+++ Programs/scr_linux.c
@@ -816,7 +816,7 @@
       key = (key - 'A') + 'a';
       modShift = 1;
     } else if (!(key & 0XE0)) {
-      key += 'a';
+      key |= 0X40;
       modControl = 1;
     }
   }


[FIX] Yara: don't swallow base qualities

--- apps/yara/misc_types.h
+++ apps/yara/misc_types.h
@@ -131,11 +131,13 @@
 // ----------------------------------------------------------------------------
 // Overloaded to load FastQ files with Iupac symbols.

+#ifdef YARA_INDEXER
 template <typename TString, typename TSSetSpec, typename TSpec>
 struct SeqFileBuffer_<StringSet<TString, TSSetSpec>, TSpec>
 {
     typedef String<Iupac>   Type;
 };
+#endif
 }

 // ============================================================================


Since we enable NX in locore now, no need to do it again later in the
bootstrap sequence

ok deraadt@

--- arch/amd64/amd64/cpu.c
+++ arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: cpu.c,v 1.67 2014/11/16 12:30:56 deraadt Exp $	*/
+/*	$OpenBSD: cpu.c,v 1.68 2014/11/21 07:02:11 mlarkin Exp $	*/
 /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */

 /*-
@@ -893,9 +893,6 @@
 	wrmsr(MSR_FSBASE, 0);
 	wrmsr(MSR_GSBASE, (u_int64_t)ci);
 	wrmsr(MSR_KERNELGSBASE, 0);
-
-	if (cpu_feature & CPUID_NXE)
-		wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_NXE);
 }

 void


knock out some useless crud

knock out some useless crud

--- arch/i386/i386/lapic.c
+++ arch/i386/i386/lapic.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: lapic.c,v 1.2 2004/06/13 21:49:15 niklas Exp $	*/
+/*	$OpenBSD: lapic.c,v 1.3 2004/06/14 00:06:32 deraadt Exp $	*/
 /* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */

 /*-
@@ -127,7 +127,7 @@
 #ifdef MULTIPROCESSOR
 	struct cpu_info *ci = curcpu();

-	if (mp_verbose) {
+	if (0) {
 		apic_format_redir(ci->ci_dev.dv_xname, "prelint", 0, 0,
 		    i82489_readreg(LAPIC_LVINT0));
 		apic_format_redir(ci->ci_dev.dv_xname, "prelint", 1, 0,
@@ -140,7 +140,7 @@
 		i82489_writereg(LAPIC_LVINT1, lapic_ints[1]->redir);

 #ifdef MULTIPROCESSOR
-	if (mp_verbose) {
+	if (0) {
 		apic_format_redir(ci->ci_dev.dv_xname, "timer", 0, 0,
 		    i82489_readreg(LAPIC_LVTT));
 		apic_format_redir(ci->ci_dev.dv_xname, "pcint", 0, 0,


Test recursive removing with varying policies

--- test/backup.c
+++ test/backup.c
@@ -388,7 +388,7 @@
 };

 /** Contains the timestamp at which a phase finished. */
-static time_t phase_timestamps[8] = { 0 };
+static time_t phase_timestamps[10] = { 0 };

 /** Finishes a backup and writes the given metadata struct into "tmp/repo".

@@ -1457,6 +1457,296 @@
   mustHaveRegularCached(bin_five_null,  &metadata->current_backup, 0,    (uint8_t *)"???",                  0);
 }

+/** Tests recursive removing of nested files with varying policies. */
+static void runPhase10(String cwd_path, size_t cwd_depth,
+                       SearchNode *phase_9_node)
+{
+  /* Remove various files. */
+  removePath("tmp/files/bin/two/three");
+  removePath("tmp/files/bin/one/b/2");
+  removePath("tmp/files/nb/a/abc/2");
+  removePath("tmp/files/nano/a2/b");
+  removePath("tmp/files/backup dir/c/1");
+  removePath("tmp/files/one/two/three/d/2");
+  removePath("tmp/files/bin/two/five/0/zero/null");
+  removePath("tmp/files/bin/two/four/a/b/c");
+  removePath("tmp/files/bin/one/d/e");
+  removePath("tmp/files/bin/one/b/1");
+  removePath("tmp/files/bin/one/a");
+  removePath("tmp/files/bin/1/2/3");
+  removePath("tmp/files/bin/a/b/d");
+  removePath("tmp/files/bin/a/b/c/1");
+  removePath("tmp/files/nb/a/abc/1");
+  removePath("tmp/files/nb/a/foo/bar");
+  removePath("tmp/files/nb/docs/1.txt");
+  removePath("tmp/files/nb/manual/b");
+  removePath("tmp/files/nb/manual/a/123.txt");
+  removePath("tmp/files/nano/a3/1/2");
+  removePath("tmp/files/nano/a2/a");
+  removePath("tmp/files/nano/a1/2");
+  removePath("tmp/files/nano/a1/1");
+  removePath("tmp/files/backup dir/c/2/3");
+  removePath("tmp/files/one/two/three/d/1");
+  removePath("tmp/files/one/two/three/b/c");
+  removePath("tmp/files/foo/dir/a/c");
+  removePath("tmp/files/foo/dir/a/b");
+  removePath("tmp/files/bin/two/five/0/zero");
+  removePath("tmp/files/bin/two/five/0");
+  removePath("tmp/files/bin/two/five");
+  removePath("tmp/files/bin/two/four/a/b");
+  removePath("tmp/files/bin/two/four/a");
+  removePath("tmp/files/bin/two/four");
+  removePath("tmp/files/bin/two");
+  removePath("tmp/files/bin/one/d");
+  removePath("tmp/files/bin/one/c");
+  removePath("tmp/files/bin/one/b");
+  removePath("tmp/files/bin/one");
+  removePath("tmp/files/bin/1/2");
+  removePath("tmp/files/bin/1");
+  removePath("tmp/files/bin/a/b/c/2");
+  removePath("tmp/files/bin/a/b/c");
+  removePath("tmp/files/bin/a/b");
+  removePath("tmp/files/bin/a");
+  removePath("tmp/files/bin");
+  removePath("tmp/files/nb/a/abc");
+  removePath("tmp/files/nb/a/foo");
+  removePath("tmp/files/nb/a");
+  removePath("tmp/files/nb/docs");
+  removePath("tmp/files/nb/manual/a");
+  removePath("tmp/files/nb/manual");
+  removePath("tmp/files/nb");
+  removePath("tmp/files/nano/a3/1/3");
+  removePath("tmp/files/nano/a3/1");
+  removePath("tmp/files/nano/a3");
+  removePath("tmp/files/nano/a2");
+  removePath("tmp/files/nano/a1");
+  removePath("tmp/files/nano");
+  removePath("tmp/files/backup dir/c/2");
+  removePath("tmp/files/backup dir/c");
+  removePath("tmp/files/backup dir/a/b");
+  removePath("tmp/files/backup dir/a");
+  removePath("tmp/files/backup dir");
+  removePath("tmp/files/one/two/three/d");
+  removePath("tmp/files/one/two/three/b");
+  removePath("tmp/files/one/two/three/a");
+  removePath("tmp/files/one/two/three");
+  removePath("tmp/files/one/two");
+  removePath("tmp/files/one");
+  removePath("tmp/files/foo/dir/a");
+  removePath("tmp/files/foo/bar/test/path/a");
+  removePath("tmp/files/foo/bar/test/path");
+  removePath("tmp/files/foo/bar/test");
+  removePath("tmp/files/foo/dir/empty");
+  removePath("tmp/files/foo/dir");
+
+  /* Initiate the backup. */
+  Metadata *metadata = metadataLoad("tmp/repo/metadata");
+  assert_true(metadata->total_path_count == cwd_depth + 84);
+  checkHistPoint(metadata, 0, 0, phase_timestamps[8], cwd_depth + 78);
+  checkHistPoint(metadata, 1, 1, phase_timestamps[2], 1);
+  checkHistPoint(metadata, 2, 2, phase_timestamps[0], 6);
+  initiateBackup(metadata, phase_9_node);
+
+  /* Check the initiated backup. */
+  checkMetadata(metadata, 0, true);
+  assert_true(metadata->current_backup.ref_count == cwd_depth + 14);
+  assert_true(metadata->backup_history_length == 3);
+  assert_true(metadata->total_path_count == cwd_depth + 71);
+  checkHistPoint(metadata, 0, 0, phase_timestamps[8], 62);
+  checkHistPoint(metadata, 1, 1, phase_timestamps[2], 1);
+  checkHistPoint(metadata, 2, 2, phase_timestamps[0], 6);
+
+  PathNode *files = findFilesNode(metadata, cwd_path, BH_unchanged, 6);
+  PathNode *foo = findSubnode(files, "foo", BH_unchanged, BPOL_none, 1, 3);
+  mustHaveDirectoryStat(foo, &metadata->current_backup);
+
+  PathNode *bar = findSubnode(foo, "bar", BH_unchanged, BPOL_track, 1, 3);
+  mustHaveDirectoryCached(bar, &metadata->backup_history[2]);
+  PathNode *bar_test = findSubnode(bar, "test", BH_removed, BPOL_track, 2, 1);
+  mustHaveNonExisting(bar_test, &metadata->current_backup);
+  mustHaveDirectoryCached(bar_test, &metadata->backup_history[0]);
+  PathNode *bar_path = findSubnode(bar_test, "path", BH_removed, BPOL_track, 2, 1);
+  mustHaveNonExisting(bar_path, &metadata->current_backup);
+  mustHaveDirectoryCached(bar_path, &metadata->backup_history[0]);
+  PathNode *bar_path_a = findSubnode(bar_path, "a", BH_removed, BPOL_track, 2, 0);
+  mustHaveNonExisting(bar_path_a, &metadata->current_backup);
+  mustHaveDirectoryCached(bar_path_a, &metadata->backup_history[0]);
+  PathNode *one_txt = findSubnode(bar, "1.txt", BH_unchanged, BPOL_track, 1, 0);
+  mustHaveRegularCached(one_txt, &metadata->backup_history[2], 12, (uint8_t *)"A small file", 0);
+  PathNode *two_txt = findSubnode(bar, "2.txt", BH_unchanged, BPOL_track, 2, 0);
+  mustHaveNonExisting(two_txt, &metadata->backup_history[1]);
+  mustHaveRegularCached(two_txt, &metadata->backup_history[2], 0, (uint8_t *)"???", 0);
+
+  PathNode *some_file = findSubnode(foo, "some file", BH_unchanged, BPOL_copy, 1, 0);
+  mustHaveRegularStat(some_file, &metadata->backup_history[2], 84, some_file_hash, 0);
+
+  PathNode *dir = findSubnode(foo, "dir", BH_removed, BPOL_none, 1, 3);
+  mustHaveDirectoryCached(dir, &metadata->backup_history[0]);
+  PathNode *link = findSubnode(dir, "link", BH_none, BPOL_copy, 1, 0);
+  mustHaveSymlinkLCached(link, &metadata->backup_history[2], "../some file");
+  PathNode *empty = findSubnode(dir, "empty", BH_none, BPOL_copy, 1, 0);
+  mustHaveDirectoryCached(empty, &metadata->backup_history[2]);
+  PathNode *dir_a = findSubnode(dir, "a", BH_none, BPOL_none, 1, 2);
+  mustHaveDirectoryCached(dir_a, &metadata->backup_history[0]);
+  PathNode *dir_b = findSubnode(dir_a, "b", BH_none, BPOL_track, 1, 0);
+  mustHaveRegularCached(dir_b, &metadata->backup_history[0], 8, (uint8_t *)"12321232", 0);
+  PathNode *dir_c = findSubnode(dir_a, "c", BH_none, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(dir_c, &metadata->backup_history[0], 8, (uint8_t *)"abcdedcb", 0);
+
+  PathNode *one = findSubnode(files, "one", BH_removed, BPOL_none, 1, 1);
+  mustHaveDirectoryCached(one, &metadata->backup_history[0]);
+  PathNode *two = findSubnode(one, "two", BH_none, BPOL_none, 1, 1);
+  mustHaveDirectoryCached(two, &metadata->backup_history[0]);
+  PathNode *three = findSubnode(two, "three", BH_none, BPOL_none, 1, 3);
+  mustHaveDirectoryCached(three, &metadata->backup_history[0]);
+  PathNode *three_a = findSubnode(three, "a", BH_none, BPOL_copy, 1, 0);
+  mustHaveDirectoryCached(three_a, &metadata->backup_history[0]);
+  PathNode *three_b = findSubnode(three, "b", BH_none, BPOL_track, 1, 1);
+  mustHaveDirectoryCached(three_b, &metadata->backup_history[0]);
+  PathNode *three_c = findSubnode(three_b, "c", BH_none, BPOL_track, 1, 0);
+  mustHaveRegularCached(three_c, &metadata->backup_history[0], 12, (uint8_t *)"FooFooFooFoo", 0);
+  PathNode *three_d = findSubnode(three, "d", BH_none, BPOL_mirror, 1, 2);
+  mustHaveDirectoryCached(three_d, &metadata->backup_history[0]);
+  PathNode *three_1 = findSubnode(three_d, "1", BH_none, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(three_1, &metadata->backup_history[0], 15, (uint8_t *)"BARBARBARBARBAR", 0);
+  PathNode *three_2 = findSubnode(three_d, "2", BH_none, BPOL_mirror, 1, 0);
+  mustHaveSymlinkLCached(three_2, &metadata->backup_history[0], "/dev/null");
+
+  PathNode *backup_dir = findSubnode(files, "backup dir", BH_removed, BPOL_copy, 1, 2);
+  mustHaveDirectoryCached(backup_dir, &metadata->backup_history[0]);
+  PathNode *backup_dir_a = findSubnode(backup_dir, "a", BH_none, BPOL_copy, 1, 1);
+  mustHaveDirectoryCached(backup_dir_a, &metadata->backup_history[0]);
+  PathNode *backup_dir_b = findSubnode(backup_dir_a, "b", BH_none, BPOL_copy, 1, 0);
+  mustHaveDirectoryCached(backup_dir_b, &metadata->backup_history[0]);
+  PathNode *backup_dir_c = findSubnode(backup_dir, "c", BH_none, BPOL_copy, 1, 2);
+  mustHaveDirectoryCached(backup_dir_c, &metadata->backup_history[0]);
+  PathNode *backup_dir_1 = findSubnode(backup_dir_c, "1", BH_none, BPOL_copy, 1, 0);
+  mustHaveSymlinkLCached(backup_dir_1, &metadata->backup_history[0], "/proc/cpuinfo");
+  PathNode *backup_dir_2 = findSubnode(backup_dir_c, "2", BH_none, BPOL_copy, 1, 1);
+  mustHaveDirectoryCached(backup_dir_2, &metadata->backup_history[0]);
+  PathNode *backup_dir_3 = findSubnode(backup_dir_2, "3", BH_none, BPOL_copy, 1, 0);
+  mustHaveRegularCached(backup_dir_3, &metadata->backup_history[0], 11, (uint8_t *)"Lorem Ipsum", 0);
+
+  PathNode *nano = findSubnode(files, "nano", BH_removed, BPOL_copy, 1, 3);
+  mustHaveDirectoryCached(nano, &metadata->backup_history[0]);
+  PathNode *nano_a1 = findSubnode(nano, "a1", BH_none, BPOL_track, 1, 2);
+  mustHaveDirectoryCached(nano_a1, &metadata->backup_history[0]);
+  PathNode *nano_a1_1 = findSubnode(nano_a1, "1", BH_none, BPOL_track, 1, 0);
+  mustHaveRegularCached(nano_a1_1, &metadata->backup_history[0], 0, (uint8_t *)"%%%%", 0);
+  PathNode *nano_a1_2 = findSubnode(nano_a1, "2", BH_none, BPOL_track, 1, 0);
+  mustHaveRegularCached(nano_a1_2, &metadata->backup_history[0], 20, (uint8_t *)"@@@@@@@@@@@@@@@@@@@@", 0);
+  PathNode *nano_a2 = findSubnode(nano, "a2", BH_none, BPOL_copy, 1, 2);
+  mustHaveDirectoryCached(nano_a2, &metadata->backup_history[0]);
+  PathNode *nano_a2_a = findSubnode(nano_a2, "a", BH_none, BPOL_copy, 1, 0);
+  mustHaveRegularCached(nano_a2_a, &metadata->backup_history[0], 20, (uint8_t *)"[][][][][][][][][][]", 0);
+  PathNode *nano_a2_b = findSubnode(nano_a2, "b", BH_none, BPOL_copy, 1, 0);
+  mustHaveSymlinkLCached(nano_a2_b, &metadata->backup_history[0], "../../non-existing.txt");
+  PathNode *nano_a3 = findSubnode(nano, "a3", BH_none, BPOL_mirror, 1, 1);
+  mustHaveDirectoryCached(nano_a3, &metadata->backup_history[0]);
+  PathNode *nano_a3_1 = findSubnode(nano_a3, "1", BH_none, BPOL_mirror, 1, 2);
+  mustHaveDirectoryCached(nano_a3_1, &metadata->backup_history[0]);
+  PathNode *nano_a3_2 = findSubnode(nano_a3_1, "2", BH_none, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(nano_a3_2, &metadata->backup_history[0], 11, (uint8_t *) "^foo$\n^bar$", 0);
+  PathNode *nano_a3_3 = findSubnode(nano_a3_1, "3", BH_none, BPOL_mirror, 1, 0);
+  mustHaveDirectoryCached(nano_a3_3, &metadata->backup_history[0]);
+
+  PathNode *nb = findSubnode(files, "nb", BH_not_part_of_repository, BPOL_mirror, 1, 3);
+  mustHaveDirectoryCached(nb, &metadata->backup_history[0]);
+  PathNode *manual = findSubnode(nb, "manual", BH_not_part_of_repository, BPOL_track, 1, 2);
+  mustHaveDirectoryCached(manual, &metadata->backup_history[0]);
+  PathNode *manual_a = findSubnode(manual, "a", BH_not_part_of_repository, BPOL_track, 1, 1);
+  mustHaveDirectoryCached(manual_a, &metadata->backup_history[0]);
+  PathNode *manual_123_txt = findSubnode(manual_a, "123.txt", BH_not_part_of_repository, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(manual_123_txt, &metadata->backup_history[0], 9, (uint8_t *)"-CONTENT-", 0);
+  PathNode *manual_b = findSubnode(manual, "b", BH_not_part_of_repository, BPOL_track, 1, 0);
+  mustHaveRegularCached(manual_b, &metadata->backup_history[0], 21, nb_manual_b_hash, 0);
+  PathNode *docs = findSubnode(nb, "docs", BH_not_part_of_repository, BPOL_copy, 1, 1);
+  mustHaveDirectoryCached(docs, &metadata->backup_history[0]);
+  PathNode *docs_1_txt = findSubnode(docs, "1.txt", BH_not_part_of_repository, BPOL_copy, 1, 0);
+  mustHaveRegularCached(docs_1_txt, &metadata->backup_history[0], 21, nb_manual_b_hash, 0);
+  PathNode *nb_a = findSubnode(nb, "a", BH_not_part_of_repository, BPOL_mirror, 1, 2);
+  mustHaveDirectoryCached(nb_a, &metadata->backup_history[0]);
+  PathNode *nb_a_foo = findSubnode(nb_a, "foo", BH_not_part_of_repository, BPOL_mirror, 1, 1);
+  mustHaveDirectoryCached(nb_a_foo, &metadata->backup_history[0]);
+  PathNode *nb_a_bar = findSubnode(nb_a_foo, "bar", BH_not_part_of_repository, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(nb_a_bar, &metadata->backup_history[0], 20, (uint8_t *)"qqqqqqqqqqqqqqqqqqqq", 0);
+  PathNode *nb_a_abc = findSubnode(nb_a, "abc", BH_not_part_of_repository, BPOL_track, 1, 2);
+  mustHaveDirectoryCached(nb_a_abc, &metadata->backup_history[0]);
+  PathNode *nb_a_abc_1 = findSubnode(nb_a_abc, "1", BH_not_part_of_repository, BPOL_track, 1, 0);
+  mustHaveRegularCached(nb_a_abc_1, &metadata->backup_history[0], 24, nb_a_abc_1_hash, 0);
+  PathNode *nb_a_abc_2 = findSubnode(nb_a_abc, "2", BH_not_part_of_repository, BPOL_track, 1, 0);
+  mustHaveSymlinkLCached(nb_a_abc_2, &metadata->backup_history[0], "../non-existing-dir");
+
+  PathNode *bin = findSubnode(files, "bin", BH_removed, BPOL_track, 2, 4);
+  mustHaveNonExisting(bin, &metadata->current_backup);
+  mustHaveDirectoryCached(bin, &metadata->backup_history[0]);
+  PathNode *bin_a = findSubnode(bin, "a", BH_removed, BPOL_copy, 1, 1);
+  mustHaveDirectoryCached(bin_a, &metadata->backup_history[0]);
+  PathNode *bin_b = findSubnode(bin_a, "b", BH_none, BPOL_copy, 1, 2);
+  mustHaveDirectoryCached(bin_b, &metadata->backup_history[0]);
+  PathNode *bin_c = findSubnode(bin_b, "c", BH_none, BPOL_track, 1, 2);
+  mustHaveDirectoryCached(bin_c, &metadata->backup_history[0]);
+  PathNode *bin_c_1 = findSubnode(bin_c, "1", BH_none, BPOL_track, 1, 0);
+  mustHaveRegularCached(bin_c_1, &metadata->backup_history[0], 1200, bin_c_1_hash, 0);
+  PathNode *bin_c_2 = findSubnode(bin_c, "2", BH_none, BPOL_track, 1, 0);
+  mustHaveDirectoryCached(bin_c_2, &metadata->backup_history[0]);
+  PathNode *bin_d = findSubnode(bin_b, "d", BH_none, BPOL_copy, 1, 0);
+  mustHaveRegularCached(bin_d, &metadata->backup_history[0], 1200, data_d_hash, 0);
+  PathNode *bin_1 = findSubnode(bin, "1", BH_removed, BPOL_track, 2, 1);
+  mustHaveNonExisting(bin_1, &metadata->current_backup);
+  mustHaveDirectoryCached(bin_1, &metadata->backup_history[0]);
+  PathNode *bin_2 = findSubnode(bin_1, "2", BH_removed, BPOL_track, 2, 1);
+  mustHaveNonExisting(bin_2, &metadata->current_backup);
+  mustHaveDirectoryCached(bin_2, &metadata->backup_history[0]);
+  PathNode *bin_3 = findSubnode(bin_2, "3", BH_removed, BPOL_track, 2, 0);
+  mustHaveNonExisting(bin_3, &metadata->current_backup);
+  mustHaveRegularCached(bin_3, &metadata->backup_history[0], 144, nested_1_hash, 0);
+  PathNode *bin_one = findSubnode(bin, "one", BH_removed, BPOL_mirror, 1, 4);
+  mustHaveDirectoryCached(bin_one, &metadata->backup_history[0]);
+  PathNode *bin_one_a = findSubnode(bin_one, "a", BH_none, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(bin_one_a, &metadata->backup_history[0], 400, three_hash, 0);
+  PathNode *bin_one_b = findSubnode(bin_one, "b", BH_none, BPOL_track, 1, 2);
+  mustHaveDirectoryCached(bin_one_b, &metadata->backup_history[0]);
+  PathNode *bin_one_1 = findSubnode(bin_one_b, "1", BH_none, BPOL_track, 1, 0);
+  mustHaveRegularCached(bin_one_1, &metadata->backup_history[0], 5, (uint8_t *)"dummy", 0);
+  PathNode *bin_one_2 = findSubnode(bin_one_b, "2", BH_none, BPOL_track, 1, 0);
+  mustHaveSymlinkLCached(bin_one_2, &metadata->backup_history[0], "/usr/share/doc");
+  PathNode *bin_one_c = findSubnode(bin_one, "c", BH_none, BPOL_mirror, 1, 0);
+  mustHaveDirectoryCached(bin_one_c, &metadata->backup_history[0]);
+  PathNode *bin_one_d = findSubnode(bin_one, "d", BH_none, BPOL_mirror, 1, 1);
+  mustHaveDirectoryCached(bin_one_d, &metadata->backup_history[0]);
+  PathNode *bin_one_e = findSubnode(bin_one_d, "e", BH_none, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(bin_one_e, &metadata->backup_history[0], 2100, super_hash, 0);
+  PathNode *bin_two = findSubnode(bin, "two", BH_removed, BPOL_track, 2, 3);
+  mustHaveNonExisting(bin_two, &metadata->current_backup);
+  mustHaveDirectoryCached(bin_two, &metadata->backup_history[0]);
+  PathNode *bin_three = findSubnode(bin_two, "three", BH_removed, BPOL_track, 2, 0);
+  mustHaveNonExisting(bin_three, &metadata->current_backup);
+  mustHaveSymlinkLCached(bin_three, &metadata->backup_history[0], "/root/.vimrc");
+  PathNode *bin_four = findSubnode(bin_two, "four", BH_removed, BPOL_track, 2, 1);
+  mustHaveNonExisting(bin_four, &metadata->current_backup);
+  mustHaveDirectoryCached(bin_four, &metadata->backup_history[0]);
+  PathNode *bin_four_a = findSubnode(bin_four, "a", BH_removed, BPOL_copy, 1, 1);
+  mustHaveDirectoryCached(bin_four_a, &metadata->backup_history[0]);
+  PathNode *bin_four_b = findSubnode(bin_four_a, "b", BH_none, BPOL_copy, 1, 1);
+  mustHaveDirectoryCached(bin_four_b, &metadata->backup_history[0]);
+  PathNode *bin_four_c = findSubnode(bin_four_b, "c", BH_none, BPOL_copy, 1, 0);
+  mustHaveRegularCached(bin_four_c, &metadata->backup_history[0], 19, (uint8_t *)"###################", 0);
+  PathNode *bin_five = findSubnode(bin_two, "five", BH_removed, BPOL_track, 2, 1);
+  mustHaveNonExisting(bin_five, &metadata->current_backup);
+  mustHaveDirectoryCached(bin_five, &metadata->backup_history[0]);
+  PathNode *bin_five_0 = findSubnode(bin_five, "0", BH_removed, BPOL_mirror, 1, 1);
+  mustHaveDirectoryCached(bin_five_0, &metadata->backup_history[0]);
+  PathNode *bin_five_zero = findSubnode(bin_five_0, "zero", BH_none, BPOL_mirror, 1, 1);
+  mustHaveDirectoryCached(bin_five_zero, &metadata->backup_history[0]);
+  PathNode *bin_five_null = findSubnode(bin_five_zero, "null", BH_none, BPOL_mirror, 1, 0);
+  mustHaveRegularCached(bin_five_null, &metadata->backup_history[0], 0, (uint8_t *)"???", 0);
+
+  /* Finish backup and perform additional checks. */
+  completeBackup(metadata, 9);
+  assert_true(countFilesInDir("tmp/repo") == 11);
+}
+
 int main(void)
 {
   testGroupStart("prepare backup");
@@ -1509,4 +1799,8 @@
   testGroupStart("generate nested files with varying policies");
   runPhase9(cwd, cwd_depth, phase_9_node);
   testGroupEnd();
-}
+
+  testGroupStart("recursive removing of paths with varying policies");
+  runPhase10(cwd, cwd_depth, phase_9_node);
+  testGroupEnd();
+}


[MIPS] Add topology_init.      A recent patch introduced cpu topology in sysfs.  When you run a kernel with SMP and sysfs enabled, you now get an Oops on boot. The following patch fixes that by adding topology_init to arch/mips/kernel/smp.c. The code is copied from arch/s390/kernel/smp.c.      Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

[MIPS] Add topology_init.

A recent patch introduced cpu topology in sysfs.  When you run a kernel
with SMP and sysfs enabled, you now get an Oops on boot. The following
patch fixes that by adding topology_init to arch/mips/kernel/smp.c. The
code is copied from arch/s390/kernel/smp.c.

Signed-off-by: Rojhalat Ibrahim <8be9b1cd0c90c7d0635894cc0c2d910ecec17651@rtschenk.de>
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

--- arch/mips/kernel/smp.c
+++ arch/mips/kernel/smp.c
@@ -29,6 +29,7 @@
 #include <linux/timex.h>
 #include <linux/sched.h>
 #include <linux/cpumask.h>
+#include <linux/cpu.h>

 #include <asm/atomic.h>
 #include <asm/cpu.h>
@@ -424,6 +425,25 @@
 	local_flush_tlb_one(vaddr);
 }

+static DEFINE_PER_CPU(struct cpu, cpu_devices);
+
+static int __init topology_init(void)
+{
+	int cpu;
+	int ret;
+
+	for_each_cpu(cpu) {
+		ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL);
+		if (ret)
+			printk(KERN_WARNING "topology_init: register_cpu %d "
+			       "failed (%d)\n", cpu, ret);
+	}
+
+	return 0;
+}
+
+subsys_initcall(topology_init);
+
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(flush_tlb_one);
 EXPORT_SYMBOL(cpu_data);


powerpc/numa: Use of_get_next_parent to simplify code

of_get_next_parent can be used to simplify the while() loop and
avoid the need of a temp variable.

Signed-off-by: Christophe JAILLET <aa5b4d6ac057e7b0849afbbced06a03fc6c87d45@wanadoo.fr>
Signed-off-by: Michael Ellerman <864f124608374e06e4da1fa5d2e47ed839b95411@ellerman.id.au>

--- arch/powerpc/mm/numa.c
+++ arch/powerpc/mm/numa.c
@@ -276,7 +276,6 @@
 /* Walk the device tree upwards, looking for an associativity id */
 int of_node_to_nid(struct device_node *device)
 {
-	struct device_node *tmp;
 	int nid = -1;

 	of_node_get(device);
@@ -285,9 +284,7 @@
 		if (nid != -1)
 			break;

-	        tmp = device;
-		device = of_get_parent(tmp);
-		of_node_put(tmp);
+		device = of_get_next_parent(device);
 	}
 	of_node_put(device);


[S390] Use copy_to_absolute_zero() instead of "stura/sturg"

Use the new copy_to_absolute_zero() function instead of manual "stura"
and "sturg" to make the code shorter and more readable.

Signed-off-by: Michael Holzheu <db4757c56f54651f568cc7cda79cd93c781b1605@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>

--- arch/s390/kernel/ipl.c
+++ arch/s390/kernel/ipl.c
@@ -1498,30 +1498,12 @@

 static void dump_reipl_run(struct shutdown_trigger *trigger)
 {
-	preempt_disable();
-	/*
-	 * Bypass dynamic address translation (DAT) when storing IPL parameter
-	 * information block address and checksum into the prefix area
-	 * (corresponding to absolute addresses 0-8191).
-	 * When enhanced DAT applies and the STE format control in one,
-	 * the absolute address is formed without prefixing. In this case a
-	 * normal store (stg/st) into the prefix area would no more match to
-	 * absolute addresses 0-8191.
-	 */
-#ifdef CONFIG_64BIT
-	asm volatile("sturg %0,%1"
-		:: "a" ((unsigned long) reipl_block_actual),
-		"a" (&lowcore_ptr[smp_processor_id()]->ipib));
-#else
-	asm volatile("stura %0,%1"
-		:: "a" ((unsigned long) reipl_block_actual),
-		"a" (&lowcore_ptr[smp_processor_id()]->ipib));
-#endif
-	asm volatile("stura %0,%1"
-		:: "a" (csum_partial(reipl_block_actual,
-				     reipl_block_actual->hdr.len, 0)),
-		"a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum));
-	preempt_enable();
+	u32 csum;
+
+	csum = csum_partial(reipl_block_actual, reipl_block_actual->hdr.len, 0);
+	copy_to_absolute_zero(&S390_lowcore.ipib_checksum, &csum, sizeof(csum));
+	copy_to_absolute_zero(&S390_lowcore.ipib, &reipl_block_actual,
+			      sizeof(reipl_block_actual));
 	dump_run(trigger);
 }


allow extension of the lifetime of ContextStorage. (#1214)

--- api/include/opentelemetry/context/runtime_context.h
+++ api/include/opentelemetry/context/runtime_context.h
@@ -150,6 +150,18 @@
     GetStorage() = storage;
   }

+  /**
+   * Provide a pointer to const runtime context storage.
+   *
+   * The returned pointer can only be used for extending the lifetime of the runtime context
+   * storage.
+   *
+   */
+  static nostd::shared_ptr<const RuntimeContextStorage> GetConstRuntimeContextStorage() noexcept
+  {
+    return GetRuntimeContextStorage();
+  }
+
 private:
   static nostd::shared_ptr<RuntimeContextStorage> GetRuntimeContextStorage() noexcept
   {


Fix for the bug in complex() just reported by Ping.

--- Python/bltinmodule.c
+++ Python/bltinmodule.c
@@ -591,12 +591,18 @@
 		}
 	}
 	else {
-		tmp = (*nbr->nb_float)(r);
+		tmp = PyNumber_Float(r);
 		if (own_r) {
 			Py_DECREF(r);
 		}
 		if (tmp == NULL)
 			return NULL;
+		if (!PyFloat_Check(tmp)) {
+			PyErr_SetString(PyExc_TypeError,
+					"float(r) didn't return a float");
+			Py_DECREF(tmp);
+			return NULL;
+		}
 		cr.real = PyFloat_AsDouble(tmp);
 		Py_DECREF(tmp);
 		cr.imag = 0.0;


[S390] disable cpu measurement alerts on a dying cpu

The cpu measurement alerts that are used for instance by oprofile
for hardware sampling are not turned off on a cpu that is going
offline. Add the appropriate control register bit that should be
disabled to the list.

Signed-off-by: Jan Glauber <91a6ce52bf23f30aed3c81da3c0c6b8e332ad699@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>


sh: Fix access to released memory in dwarf_unwinder_cleanup()

Signed-off-by: Marek Skuczynski <fe0e8380b8b32a16af4dd30fd1eddcf0d56ca13c@gmail.com>
Acked-by: Matt Fleming <1fa2ef4755a9226cb9a0a4840bd89b158ac71391@console-pimps.org>
Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- arch/sh/kernel/dwarf.c
+++ arch/sh/kernel/dwarf.c
@@ -892,18 +892,18 @@

 static void dwarf_unwinder_cleanup(void)
 {
-	struct dwarf_cie *cie;
-	struct dwarf_fde *fde;
+	struct dwarf_cie *cie, *cie_tmp;
+	struct dwarf_fde *fde, *fde_tmp;

 	/*
 	 * Deallocate all the memory allocated for the DWARF unwinder.
 	 * Traverse all the FDE/CIE lists and remove and free all the
 	 * memory associated with those data structures.
 	 */
-	list_for_each_entry(cie, &dwarf_cie_list, link)
+	list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link)
 		kfree(cie);

-	list_for_each_entry(fde, &dwarf_fde_list, link)
+	list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link)
 		kfree(fde);

 	kmem_cache_destroy(dwarf_reg_cachep);


call-window: set remote contact's name in window's title. Fixes #530119

--- src/empathy-call-window.c
+++ src/empathy-call-window.c
@@ -579,6 +579,30 @@
   g_object_unref (gui);
 }

+static void
+empathy_call_window_constructed (GObject *object)
+{
+  EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
+  EmpathyContact *contact;
+
+  g_assert (priv->handler != NULL);
+
+  g_object_get (priv->handler, "contact", &contact, NULL);
+
+  if (contact != NULL)
+    {
+      gchar *tmp;
+
+      tmp = g_strdup_printf (_("Call with %s"),
+          empathy_contact_get_name (contact));
+      gtk_window_set_title (GTK_WINDOW (self), tmp);
+
+      g_free (tmp);
+      g_object_unref (contact);
+    }
+}
+
 static void empathy_call_window_dispose (GObject *object);
 static void empathy_call_window_finalize (GObject *object);

@@ -624,6 +648,7 @@
   g_type_class_add_private (empathy_call_window_class,
     sizeof (EmpathyCallWindowPriv));

+  object_class->constructed = empathy_call_window_constructed;
   object_class->set_property = empathy_call_window_set_property;
   object_class->get_property = empathy_call_window_get_property;


Don't try to offer file transfers to MUCs

--- src/empathy-chat-window.c
+++ src/empathy-chat-window.c
@@ -1416,6 +1416,14 @@
 		gchar *nl;
 		gchar *uri;

+		priv = GET_PRIV (window);
+		contact = empathy_chat_get_remote_contact (priv->current_chat);
+
+		if (!EMPATHY_IS_CONTACT (contact)) {
+			gtk_drag_finish (context, TRUE, FALSE, time);
+			return;
+		}
+
 		/* Only handle a single file for new.  It would be wicked cool to be
 		   able to do multiple files, offering to zip them or whatever like
 		   nautilus-sendto does.  Note that text/uri-list is defined to have
@@ -1436,8 +1444,6 @@
 			file = g_file_new_for_uri (data);
 		}

-		priv = GET_PRIV (window);
-		contact = empathy_chat_get_remote_contact (priv->current_chat);
 		empathy_send_file (contact, file);

 		g_object_unref (file);


note that the next block cannot be nil

note that the next block cannot be nil

--- ReactiveCocoaFramework/ReactiveCocoa/RACSubscribable.h
+++ ReactiveCocoaFramework/ReactiveCocoa/RACSubscribable.h
@@ -53,7 +53,7 @@
 // generate the next value.
 //
 // block - The block that generates a new value from the previous value. When
-// the block returns nil, the subscribable completes.
+// the block returns nil, the subscribable completes. Cannot be nil.
 + (instancetype)generatorWithScheduler:(RACScheduler *)scheduler start:(id)start next:(id (^)(id x))block;

 // Calls `+generateWithScheduler:start:block:` with a nil scheduler.


main-window: use empathy_account_get_error_message (#523895)

--- src/empathy-main-window.c
+++ src/empathy-main-window.c
@@ -432,13 +432,10 @@
 	GtkWidget *action_table;
 	gchar     *str;
 	const gchar     *icon_name;
-	const gchar *message;
-
-	message = empathy_status_reason_get_default_message (reason);

 	str = g_markup_printf_escaped ("<b>%s</b>\n%s",
 					       tp_account_get_display_name (account),
-					       message);
+					       empathy_account_get_error_message (account, reason));

 	info_bar = g_hash_table_lookup (priv->errors, account);
 	if (info_bar) {


* clutter-md2/clutter-md2.c: The vertex bytes should be unsigned

--- clutter-md2/clutter-md2.c
+++ clutter-md2/clutter-md2.c
@@ -72,7 +72,7 @@
   float scale[3];
   float translate[3];
   char name[CLUTTER_MD2_MAX_FRAME_NAME_LEN + 1];
-  gchar vertices[1];
+  guchar vertices[1];
 };

 enum
@@ -142,7 +142,7 @@
   ClutterMD2Private *priv = md2->priv;
   ClutterGeometry geom;
   ClutterMD2Frame *frame;
-  gchar *vertices;
+  guchar *vertices;
   guchar *gl_command;

   if (priv->gl_commands == NULL || priv->frames == NULL
@@ -179,7 +179,7 @@
 	{
 	  float s, t;
 	  int vertex_num;
-	  gchar *vertex;
+	  guchar *vertex;

 	  s = *(float *) gl_command;
 	  gl_command += sizeof (float);


texture: Do some more validation in get_cogl_texture()

Check the layer type, even though right now we only have one type
available.

--- clutter/clutter-texture.c
+++ clutter/clutter-texture.c
@@ -1306,7 +1306,6 @@

   cogl_handle_ref (cogl_material);

-  /* This */
   if (texture->priv->material)
     cogl_handle_unref (texture->priv->material);

@@ -1341,14 +1340,22 @@
 CoglHandle
 clutter_texture_get_cogl_texture (ClutterTexture *texture)
 {
+  CoglMaterialLayerType layer_type;
   const GList *layers;
   int n_layers;

   g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), COGL_INVALID_HANDLE);

   layers = cogl_material_get_layers (texture->priv->material);
+  if (layers == NULL)
+    return COGL_INVALID_HANDLE;
+
   n_layers = g_list_length ((GList *)layers);
   if (n_layers == 0)
+    return COGL_INVALID_HANDLE;
+
+  layer_type = cogl_material_layer_get_type (layers->data);
+  if (layer_type != COGL_MATERIAL_LAYER_TYPE_TEXTURE)
     return COGL_INVALID_HANDLE;

   return cogl_material_layer_get_texture (layers->data);


Fix ReferenceType Aggregates shall be abstract

See OPC UA Spec. Part 5, 1.04, Table 102.

--- src/server/ua_server_ns0.c
+++ src/server/ua_server_ns0.c
@@ -100,7 +100,7 @@

     UA_ReferenceTypeAttributes aggregates_attr = UA_ReferenceTypeAttributes_default;
     aggregates_attr.displayName = UA_LOCALIZEDTEXT("", "Aggregates");
-    aggregates_attr.isAbstract = false;
+    aggregates_attr.isAbstract = true;
     aggregates_attr.symmetric = false;
     aggregates_attr.inverseName = UA_LOCALIZEDTEXT("", "AggregatedBy");
     ret |= addNode_raw(server, UA_NODECLASS_REFERENCETYPE, UA_NS0ID_AGGREGATES, "Aggregates",


separated volumes per music channel are required to properly mix them

--- dependencies/SDL_mixer/jni/music.c
+++ dependencies/SDL_mixer/jni/music.c
@@ -77,7 +77,8 @@
 static Mix_Music* music_compat_stream = NULL;
 static int volatile music_stopped = 0;
 static char *music_cmd = NULL;
-static int music_volume = MIX_MAX_VOLUME;
+// use a separate volume setting per music channel
+// static int music_volume = MIX_MAX_VOLUME;

 struct _Mix_Music {
     Mix_MusicType type;
@@ -123,6 +124,7 @@
     int fade_step;
     int fade_steps;
 	Sint32 duration_ms;
+	int volume;
     int error;
 };
 #ifdef MID_MUSIC
@@ -271,9 +273,9 @@
 			int fade_steps = music_playing->fade_steps;

 			if ( music_playing->fading == MIX_FADING_OUT ) {
-				volume = (music_volume * (fade_steps-fade_step)) / fade_steps;
+				volume = (music_playing->volume * (fade_steps-fade_step)) / fade_steps;
 			} else { /* Fading in */
-				volume = (music_volume * fade_step) / fade_steps;
+				volume = (music_playing->volume * fade_step) / fade_steps;
 			}
 			music_internal_volume(music_playing, volume);
 		} else {
@@ -1065,6 +1067,7 @@
     }
     music->fade_step = 0;
     music->fade_steps = ms/ms_per_step;
+	music->volume = MIX_MAX_VOLUME;

     /* Play the puppy */
     SDL_LockAudio();
@@ -1222,7 +1225,7 @@
 	if ( music_playing->fading == MIX_FADING_IN ) {
 		music_internal_volume(music_playing, 0);
 	} else {
-		music_internal_volume(music_playing, music_volume);
+		music_internal_volume(music_playing, music_playing->volume);
 	}
 }

@@ -1299,17 +1302,14 @@
 }
 int Mix_VolumeMusicCh(int volume, int channel)
 {
-    int prev_volume;
+    int prev_volume = -1;
 	Mix_Music* music_playing;

-    prev_volume = music_volume;
-    if ( volume < 0 ) {
-        return prev_volume;
-    }
+	// limit volume
     if ( volume > SDL_MIX_MAXVOLUME ) {
         volume = SDL_MIX_MAXVOLUME;
     }
-    music_volume = volume;
+
     SDL_LockAudio();
 	if ( channel == MUSIC_COMPAT_MAGIC_CHANNEL ) {
 		music_playing = music_compat_stream;
@@ -1317,7 +1317,15 @@
 		music_playing = _ChannelPlayingMusic(channel);
 	}
     if ( music_playing ) {
-    	music_internal_volume(music_playing, music_volume);
+		// find previous volume
+		prev_volume = music_playing->volume;
+
+		// apply new volume if it wasnt a query
+		if (volume >= 0)
+		{
+			music_playing->volume = volume;
+			music_internal_volume(music_playing, volume);
+		}
     }
     SDL_UnlockAudio();
     return(prev_volume);


Verify that lua_getuservalue returns type.

Closes #39.

--- tests/testmod.c
+++ tests/testmod.c
@@ -225,9 +225,9 @@
   int ui = lua_gettop(L);
   lua_newtable(L);
   lua_setuservalue(L, ui);
-  lua_getuservalue(L, ui);
+  lua_pushinteger(L, lua_getuservalue(L, ui));
   (void)udata;
-  return 1;
+  return 2;
 }

 static int test_upvalues (lua_State *L) {


Debug queueMovement

Debug queueMovement

--- code/firmware/src/state.h
+++ code/firmware/src/state.h
@@ -367,7 +367,8 @@
 	if (numAxis == 0) {
 		return; //some of the following logic may assume that there are at least 1 axis.
 	}*/
-	LOGD("State::queueMovement (%f, %f, %f, %f) -> (%f, %f, %f, %f)\n", curX, curY, curZ, curE x, y, z, e);
+	LOGD("State::queueMovement (%f, %f, %f, %f) -> (%f, %f, %f, %f)\n", curX, curY, curZ, curE, x, y, z, e);
+	LOGD("State::queueMovement _destMechanicalPos: %i\n", _destMechanicalPos[0]);
 	typename Drv::AxisSteppers iters;
 	drv::AxisStepper::initAxisSteppers(iters, _destMechanicalPos, vx, vy, vz, velE);
 	timespec baseTime = scheduler.lastSchedTime();


Improve observe() such to avoid cloning/emitting objects when there are no parameter observers attached.

--- src/shogun/base/SGObject.h
+++ src/shogun/base/SGObject.h
@@ -1034,7 +1034,21 @@
 	void observe(const Some<ObservedValue> value) const;

 	/**
-	 * Observe a parameter value given some information
+	 * Observe a parameter value given custom properties for the Any.
+	 * If no observer is attached this command will do nothing.
+	 * @tparam T type of the parameter
+	 * @param step time step
+	 * @param name name of the observed value
+	 * @param value observed value
+	 * @param properties AnyParameterProperties used to register the observed value.
+	 */
+	template <class T>
+	void observe(const int64_t step, const std::string& name, const T& value,
+						  const AnyParameterProperties properties) const;
+
+	/**
+	 * Observe a parameter value given some information.
+	 * If no observer is attached this command will do nothing.
 	 * @tparam T value of the parameter
 	 * @param step step
 	 * @param name name of the observed value
@@ -1048,6 +1062,7 @@

 	/**
 	 * Observe a registered tag.
+	 * If no observer is attached this command will do nothing.
 	 * @tparam T type of the tag
 	 * @param step step
 	 * @param name tag's name
@@ -1346,22 +1361,31 @@
 }

 template <class T>
+void CSGObject::observe(const int64_t step, const std::string &name, const T& value,
+								 const AnyParameterProperties properties) const
+{
+	// If there are no observers attached, do not create/emit anything.
+	if (get_num_subscriptions() == 0) return;
+
+	auto obs = some<ObservedValueTemplated<T>>(step, name, static_cast<T>(clone_utils::clone(value)), properties);
+	this->observe(obs);
+}
+
+template <class T>
 void CSGObject::observe(
 	const int64_t step, const std::string& name, const std::string& description,
 	const T value) const
 {
-	auto obs = some<ObservedValueTemplated<T>>(step, name, description, value);
-	this->observe(obs);
+	this->observe(step, name, value,
+						   AnyParameterProperties(description, ParameterProperties::READONLY));
 }

 template <class T>
 void CSGObject::observe(const int64_t step, const std::string& name) const
 {
 	auto param = this->get_parameter(BaseTag(name));
-	auto cloned = any_cast<T>(param.get_value());
-	auto obs = some<ObservedValueTemplated<T>>(
-		step, name, static_cast<T>(clone_utils::clone(cloned)), param.get_properties());
-	this->observe(obs);
+	this->observe(
+		step, name, any_cast<T>(param.get_value()), param.get_properties());
 }


fixed header path

fixed header path

--- src/spinoff.h
+++ src/spinoff.h
@@ -4,8 +4,8 @@
 #include <cstdio>
 #include <fstream>
 #include <cstring>
-#include "../json/json_spirit_value.h"
-#include "../rpcserver.h"
+#include "json/json_spirit_value.h"
+#include "rpcserver.h"

 namespace Spinoff {


snapshot

snapshot

--- src/simpla/algebra/Field.h
+++ src/simpla/algebra/Field.h
@@ -218,103 +218,91 @@
 template <typename TM, typename TV, int IFORM, int DOF>
 constexpr int Field<TM, TV, IFORM, DOF>::NUMBER_OF_SUB;  //= ((IFORM == VERTEX || IFORM == VOLUME) ? 1 : 3) * DOF;

-#define _SP_DEFINE_FIELD_BINARY_OPERATOR(_NAME_, _OP_)                                                               \
-    template <typename TM, typename TL, int NL, int DL, typename TR>                                                 \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, TR const& rhs) {                                            \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, TR const>(lhs, rhs);                    \
-    };                                                                                \
-    template <typename TL, typename TM, typename TR, int NR, int DR>                                                 \
-    auto operator _OP_(TL const& lhs, Field<TM, TR, NR, DR> const& rhs) {                                            \
-        return Expression<simpla::tags::_NAME_, TL const, const Field<TM, TR, NR, DR>>(lhs, rhs);                    \
-    };                                                                                \
-    template <typename TM, typename TL, int NL, int DL, typename... TR>                                              \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Expression<TR...> const& rhs) {                             \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, Expression<TR...> const>(lhs, rhs);     \
-    };                                                                                \
-    template <typename... TL, typename TM, typename TR, int NR, int DR>                                              \
-    auto operator _OP_(Expression<TL...> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                             \
-        return Expression<simpla::tags::_NAME_, Expression<TL...> const, const Field<TM, TR, NR, DR>>(lhs, rhs);     \
-    };                                                                                \
-    template <typename TM, typename TL, int NL, int DL, typename TR, int NR, int DR>                                 \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                         \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, const Field<TM, TR, NR, DR>>(lhs, rhs); \
+#define _SP_DEFINE_FIELD_BINARY_OPERATOR(_NAME_, _OP_)                                                       \
+    template <typename TM, typename TL, int NL, int DL, typename TR>                                         \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, TR const& rhs) {                                    \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, TR const>(lhs, rhs);                    \
+    };                                                                                \
+    template <typename TL, typename TM, typename TR, int NR, int DR>                                         \
+    auto operator _OP_(TL const& lhs, Field<TM, TR, NR, DR> const& rhs) {                                    \
+        return Expression<tags::_NAME_, TL const, const Field<TM, TR, NR, DR>>(lhs, rhs);                    \
+    };                                                                                \
+    template <typename TM, typename TL, int NL, int DL, typename... TR>                                      \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Expression<TR...> const& rhs) {                     \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, Expression<TR...> const>(lhs, rhs);     \
+    };                                                                                \
+    template <typename... TL, typename TM, typename TR, int NR, int DR>                                      \
+    auto operator _OP_(Expression<TL...> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                     \
+        return Expression<tags::_NAME_, Expression<TL...> const, const Field<TM, TR, NR, DR>>(lhs, rhs);     \
+    };                                                                                \
+    template <typename TM, typename TL, int NL, int DL, typename TR, int NR, int DR>                         \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                 \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, const Field<TM, TR, NR, DR>>(lhs, rhs); \
     };

-#define _SP_DEFINE_FIELD_UNARY_OPERATOR(_NAME_, _OP_)                              \
-    template <typename TM, typename TL, int NL, int DL>                            \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs) {                         \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>>(lhs); \
+#define _SP_DEFINE_FIELD_UNARY_OPERATOR(_NAME_, _OP_)                      \
+    template <typename TM, typename TL, int NL, int DL>                    \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs) {                 \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>>(lhs); \
     };

 _SP_DEFINE_FIELD_BINARY_OPERATOR(addition, +)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(subtraction, -)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(multiplication, *)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(division, /)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(modulo, %)
-
 _SP_DEFINE_FIELD_UNARY_OPERATOR(bitwise_not, ~)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(bitwise_xor, ^)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(bitwise_and, &)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(bitwise_or, |)

 template <typename TM, typename TL, int NL, int DL>
 auto operator<<(Field<TM, TL, NL, DL> const& lhs, int n) {
-    return Expression<simpla::tags::bitwise_left_shift, const Field<TM, TL, NL, DL>, int>(lhs, n);
+    return Expression<tags::bitwise_left_shift, const Field<TM, TL, NL, DL>, int>(lhs, n);
 };

 template <typename TM, typename TL, int NL, int DL>
 auto operator>>(Field<TM, TL, NL, DL> const& lhs, int n) {
-    return Expression<simpla::tags::bitwise_right_shifit, const Field<TM, TL, NL, DL>, int>(lhs, n);
+    return Expression<tags::bitwise_right_shifit, const Field<TM, TL, NL, DL>, int>(lhs, n);
 };
 //_SP_DEFINE_FIELD_BINARY_OPERATOR(bitwise_left_shift, <<)
 //_SP_DEFINE_FIELD_BINARY_OPERATOR(bitwise_right_shift, >>)

 _SP_DEFINE_FIELD_UNARY_OPERATOR(unary_plus, +)
-
 _SP_DEFINE_FIELD_UNARY_OPERATOR(unary_minus, -)
-
 _SP_DEFINE_FIELD_UNARY_OPERATOR(logical_not, !)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(logical_and, &&)
-
 _SP_DEFINE_FIELD_BINARY_OPERATOR(logical_or, ||)

 #undef _SP_DEFINE_FIELD_BINARY_OPERATOR
 #undef _SP_DEFINE_FIELD_UNARY_OPERATOR

-#define _SP_DEFINE_FIELD_BINARY_FUNCTION(_NAME_)                                                                     \
-    template <typename TM, typename TL, int NL, int DL, typename TR>                                                 \
-    auto _NAME_(Field<TM, TL, NL, DL> const& lhs, TR const& rhs) {                                                   \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, const TR>(lhs, rhs);                    \
-    };                                                                                \
-    template <typename TL, typename TM, typename TR, int NR, int DR>                                                 \
-    auto _NAME_(TL const& lhs, Field<TM, TR, NR, DR> const& rhs) {                                                   \
-        return Expression<simpla::tags::_NAME_, const TL, const Field<TM, TR, NR, DR>>(lhs, rhs);                    \
-    };                                                                                \
-    template <typename TM, typename TL, int NL, int DL, typename... TR>                                              \
-    auto _NAME_(Field<TM, TL, NL, DL> const& lhs, Expression<TR...> const& rhs) {                                    \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, const Expression<TR...>>(lhs, rhs);     \
-    };                                                                                \
-    template <typename... TL, typename TM, typename TR, int NR, int DR>                                              \
-    auto _NAME_(Expression<TL...> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                                    \
-        return Expression<simpla::tags::_NAME_, const Expression<TL...>, const Field<TM, TR, NR, DR>>(lhs, rhs);     \
-    };                                                                                \
-    template <typename TM, typename TL, int NL, int DL, typename TR, int NR, int DR>                                 \
-    auto _NAME_(Field<TM, TL, NL, DL> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                                \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, const Field<TM, TR, NR, DR>>(lhs, rhs); \
+#define _SP_DEFINE_FIELD_BINARY_FUNCTION(_NAME_)                                                             \
+    template <typename TM, typename TL, int NL, int DL, typename TR>                                         \
+    auto _NAME_(Field<TM, TL, NL, DL> const& lhs, TR const& rhs) {                                           \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, const TR>(lhs, rhs);                    \
+    };                                                                                \
+    template <typename TL, typename TM, typename TR, int NR, int DR>                                         \
+    auto _NAME_(TL const& lhs, Field<TM, TR, NR, DR> const& rhs) {                                           \
+        return Expression<tags::_NAME_, const TL, const Field<TM, TR, NR, DR>>(lhs, rhs);                    \
+    };                                                                                \
+    template <typename TM, typename TL, int NL, int DL, typename... TR>                                      \
+    auto _NAME_(Field<TM, TL, NL, DL> const& lhs, Expression<TR...> const& rhs) {                            \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, const Expression<TR...>>(lhs, rhs);     \
+    };                                                                                \
+    template <typename... TL, typename TM, typename TR, int NR, int DR>                                      \
+    auto _NAME_(Expression<TL...> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                            \
+        return Expression<tags::_NAME_, const Expression<TL...>, const Field<TM, TR, NR, DR>>(lhs, rhs);     \
+    };                                                                                \
+    template <typename TM, typename TL, int NL, int DL, typename TR, int NR, int DR>                         \
+    auto _NAME_(Field<TM, TL, NL, DL> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                        \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, const Field<TM, TR, NR, DR>>(lhs, rhs); \
     };

-#define _SP_DEFINE_FIELD_UNARY_FUNCTION(_NAME_)                                    \
-    template <typename TM, typename TL, int NL, int DL>                            \
-    auto _NAME_(Field<TM, TL, NL, DL> const& lhs) {                                \
-        return Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>>(lhs); \
+#define _SP_DEFINE_FIELD_UNARY_FUNCTION(_NAME_)                            \
+    template <typename TM, typename TL, int NL, int DL>                    \
+    auto _NAME_(Field<TM, TL, NL, DL> const& lhs) {                        \
+        return Expression<tags::_NAME_, const Field<TM, TL, NL, DL>>(lhs); \
     }

 _SP_DEFINE_FIELD_UNARY_FUNCTION(cos)
@@ -349,65 +337,48 @@
     }

 _SP_DEFINE_FIELD_COMPOUND_OP(+)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(-)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(*)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(/)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(%)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(&)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(|)
-
 _SP_DEFINE_FIELD_COMPOUND_OP (^)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(<<)
-
 _SP_DEFINE_FIELD_COMPOUND_OP(>>)
-
 #undef _SP_DEFINE_FIELD_COMPOUND_OP

-#define _SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(_NAME_, _REDUCTION_, _OP_)                                        \
-    template <typename TM, typename TL, int NL, int DL, typename TR>                                               \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, TR const& rhs) {                                          \
-        return reduction<_REDUCTION_>(Expression<simpla::tags::_NAME_, const Array<TL, NL>, const TR>(lhs, rhs));  \
-    };                                                                                \
-    template <typename TL, typename TM, typename TR, int NR, int DR>                                               \
-    auto operator _OP_(TL const& lhs, Array<TR, NR> const& rhs) {                                                  \
-        return reduction<_REDUCTION_>(                                                                             \
-            Expression<simpla::tags::_NAME_, const TL, const Field<TM, TR, NR, DR>>(lhs, rhs));                    \
-    };                                                                                \
-    template <typename TM, typename TL, int NL, int DL, typename... TR>                                            \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Expression<TR...> const& rhs) {                           \
-        return reduction<_REDUCTION_>(                                                                             \
-            Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, const Expression<TR...>>(lhs, rhs));     \
-    };                                                                                \
-    template <typename... TL, typename TM, typename TR, int NR, int DR>                                            \
-    auto operator _OP_(Expression<TL...> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                           \
-        return reduction<_REDUCTION_>(                                                                             \
-            Expression<simpla::tags::_NAME_, const Expression<TL...>, const Field<TM, TR, NR, DR>>(lhs, rhs));     \
-    };                                                                                \
-    template <typename TM, typename TL, int NL, int DL, typename TR, int NR, int DR>                               \
-    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                       \
-        return reduction<_REDUCTION_>(                                                                             \
-            Expression<simpla::tags::_NAME_, const Field<TM, TL, NL, DL>, const Field<TM, TR, NR, DR>>(lhs, rhs)); \
+#define _SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(_NAME_, _REDUCTION_, _OP_)                                       \
+    template <typename TM, typename TL, int NL, int DL, typename TR>                                              \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, TR const& rhs) {                                         \
+        return reduction<_REDUCTION_>(Expression<tags::_NAME_, const Array<TL, NL>, const TR>(lhs, rhs));         \
+    };                                                                                \
+    template <typename TL, typename TM, typename TR, int NR, int DR>                                              \
+    auto operator _OP_(TL const& lhs, Array<TR, NR> const& rhs) {                                                 \
+        return reduction<_REDUCTION_>(Expression<tags::_NAME_, const TL, const Field<TM, TR, NR, DR>>(lhs, rhs)); \
+    };                                                                                \
+    template <typename TM, typename TL, int NL, int DL, typename... TR>                                           \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Expression<TR...> const& rhs) {                          \
+        return reduction<_REDUCTION_>(                                                                            \
+            Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, const Expression<TR...>>(lhs, rhs));            \
+    };                                                                                \
+    template <typename... TL, typename TM, typename TR, int NR, int DR>                                           \
+    auto operator _OP_(Expression<TL...> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                          \
+        return reduction<_REDUCTION_>(                                                                            \
+            Expression<tags::_NAME_, const Expression<TL...>, const Field<TM, TR, NR, DR>>(lhs, rhs));            \
+    };                                                                                \
+    template <typename TM, typename TL, int NL, int DL, typename TR, int NR, int DR>                              \
+    auto operator _OP_(Field<TM, TL, NL, DL> const& lhs, Field<TM, TR, NR, DR> const& rhs) {                      \
+        return reduction<_REDUCTION_>(                                                                            \
+            Expression<tags::_NAME_, const Field<TM, TL, NL, DL>, const Field<TM, TR, NR, DR>>(lhs, rhs));        \
     };

-_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(not_equal_to, simpla::tags::logical_or, !=)
-
-_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(equal_to, simpla::tags::logical_and, ==)
-
-_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(less, simpla::tags::logical_and, <)
-
-_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(greater, simpla::tags::logical_and, >)
-
-_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(less_equal, simpla::tags::logical_and, <=)
-
-_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(greater_equal, simpla::tags::logical_and, >=)
-
+_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(not_equal_to, tags::logical_or, !=)
+_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(equal_to, tags::logical_and, ==)
+_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(less, tags::logical_and, <)
+_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(greater, tags::logical_and, >)
+_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(less_equal, tags::logical_and, <=)
+_SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR(greater_equal, tags::logical_and, >=)
 #undef _SP_DEFINE_FIELD_BINARY_BOOLEAN_OPERATOR

 //        static int tag[4][3] = {{0, 0, 0}, {1, 2, 4}, {6, 5, 3}, {7, 7, 7}};


DOC (#990) NodePredicateSource or similar unimplemented: Added a comment

--- Core/DataStructures/mitkDataStorage/mitkNodePredicateSource.h
+++ Core/DataStructures/mitkDataStorage/mitkNodePredicateSource.h
@@ -28,9 +28,10 @@

     //##Documentation
     //## @brief Predicate that evaluates if the given node is a direct or indirect source node of a specific node
-    //##
     //##
-    //##
+    //## @warning This class seems to be obsolete since mitk::DataStorage::GetDerivations().
+    //##          Since there is no real use case up until now, NodePredicateSource is NOT WORKING YET.
+    //##          If you need it working, inform us.
     //##
     //## @ingroup DataStorage
     class NodePredicateSource : public NodePredicateBase


CryptoPkg: Fix typos in comments

CryptoPkg: Fix typos in comments

- availabe to available

Cc: Qin Long <39a52309c812a080396e90c26873d3f69837761a@intel.com>
Cc: Ting Ye <fe1f30c12225d8cd094a72a37b5acbb01ee15159@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <25c53ebec15b492d82d7bf064153464c6e8fbfec@intel.com>
Reviewed-by: Qin Long <39a52309c812a080396e90c26873d3f69837761a@intel.com>

--- CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
+++ CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
@@ -2,7 +2,7 @@
   Light-weight Memory Management Routines for OpenSSL-based Crypto
   Library at Runtime Phase.

-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.

+Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.

 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -204,7 +204,7 @@
   }

   //
-  // No availabe region for object allocation!
+  // No available region for object allocation!
   //
   return (UINTN)(-1);
 }


Add missing public header to Firestore umbrella (#7844)

* Add missing public header to Firestore umbrella

* style

--- Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h
+++ Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h
@@ -25,6 +25,7 @@
 #import "FIRFirestoreSettings.h"
 #import "FIRGeoPoint.h"
 #import "FIRListenerRegistration.h"
+#import "FIRLoadBundleTask.h"
 #import "FIRQuery.h"
 #import "FIRQuerySnapshot.h"
 #import "FIRSnapshotMetadata.h"


Remove this from L_CALL

Remove this from L_CALL

--- src/storage.h
+++ src/storage.h
@@ -321,7 +321,7 @@
 	}

 	void initialize_file(void* args) {
-		L_CALL(this, "Storage::initialize_file()");
+		L_CALL("Storage::initialize_file()");

 		if unlikely(fd < 0) {
 			close();


* Have the C library figure out if DST is in effect or not when doing time conversions.

--- tivo_commands.c
+++ tivo_commands.c
@@ -146,6 +146,7 @@
 			{
 				struct tm tm;
 				memset(&tm, 0, sizeof(tm));
+				tm.tm_isdst = -1; // Have libc figure out if DST is in effect or not
 				strptime(date, "%Y-%m-%dT%H:%M:%S", &tm);
 				ret = sprintf(str_buf, "<CaptureDate>0x%X</CaptureDate>", (unsigned int)mktime(&tm));
 				memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
@@ -186,6 +187,7 @@
 			{
 				struct tm tm;
 				memset(&tm, 0, sizeof(tm));
+				tm.tm_isdst = -1; // Have libc figure out if DST is in effect or not
 				strptime(date, "%Y-%m-%dT%H:%M:%S", &tm);
 				ret = sprintf(str_buf, "<CaptureDate>0x%X</CaptureDate>", (unsigned int)mktime(&tm));
 				memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
@@ -705,9 +707,11 @@
 			if( val )
 				detailItem = strtoll(basename(val), NULL, 10);
 		}
-		else if( strcasecmp(key, "Format") == 0 )
-		{
-			// Only send XML
+		else if( strcasecmp(key, "Format") == 0 || // Only send XML
+		         strcasecmp(key, "SerialNum") == 0 || // Unused for now
+		         strcasecmp(key, "DoGenres") == 0 ) // Not sure what this is, so ignore it
+		{
+			;;
 		}
 		else
 		{


streams: Add data() method to CDataStream

Analogous to c++11 vector data().

--- src/streams.h
+++ src/streams.h
@@ -178,6 +178,8 @@
     void clear()                                     { vch.clear(); nReadPos = 0; }
     iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
     void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
+    value_type* data()                               { return vch.data() + nReadPos; }
+    const value_type* data() const                   { return vch.data() + nReadPos; }

     void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
     {


Struct: Fix mistake in Alias struct

Struct: Fix mistake in Alias struct

--- src/structs.h
+++ src/structs.h
@@ -350,11 +350,6 @@
 {
      char *name;
      char *content;
-     char *role;
-     int screen;
-     int tag;
-     Bool free;
-     Bool max;
 } Alias;

 /* Rule struct */


freebox: Add source-tags property

freebox: Add source-tags property

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

--- src/freebox/grl-freebox.c
+++ src/freebox/grl-freebox.c
@@ -163,6 +163,11 @@
   GIcon *icon;
   GFile *file;
   GrlFreeboxSource *object;
+  const char *tags[] = {
+    "tv",
+    "country:fr",
+    NULL
+  };

   GRL_DEBUG ("%s", __FUNCTION__);

@@ -175,6 +180,7 @@
                          "source-desc", SOURCE_DESC,
                          "supported-media", GRL_MEDIA_TYPE_VIDEO,
                          "source-icon", icon,
+                         "source-tags", tags,
                          NULL);
   return object;
 }


cleanup

cleanup

--- src/svector.c
+++ src/svector.c
@@ -351,12 +351,12 @@

 const void *sv_get_buffer_r(const sv_t *v)
 {
-	return !v ? (const void *)0 : __sv_get_buffer_r(v);
+	return !v ? NULL : __sv_get_buffer_r(v);
 }

 void *sv_get_buffer(sv_t *v)
 {
-	return !v ? (void *)0 : __sv_get_buffer(v);
+	return !v ? NULL : __sv_get_buffer(v);
 }

 size_t sv_get_buffer_size(const sv_t *v)


VPP-1299: Reset uid/gid on shared memory segment if client starts first.

Change-Id: I2b5bc7d864f8829e1dff63fec3c9484078601309
Signed-off-by: Ole Troan <aeed71d78dc09e4764ceac69b111eee9b50cfdd0@cisco.com>

--- src/svm/svm.c
+++ src/svm/svm.c
@@ -652,6 +652,10 @@
 	  return (0);
 	}

+      /* Reset ownership in case the client started first */
+      if (fchown (svm_fd, a->uid, a->gid) < 0)
+	clib_unix_warning ("segment chown [ok if client starts first]");
+
       time_left = 20;
       while (1)
 	{


Global mutex is not re-entrant.

Global mutex is not re-entrant.

--- src/svr/app.c
+++ src/svr/app.c
@@ -42,7 +42,11 @@
 	ok = sca_config_load();
 	if (!ok) return false;

-	pthread_mutex_init(&this->seacatcc_loop_lock, 0);
+	pthread_mutexattr_t mutex_attr;
+	pthread_mutexattr_init(&mutex_attr);
+	pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
+
+	pthread_mutex_init(&this->seacatcc_loop_lock, &mutex_attr);
 	ev_set_loop_release_cb(this->context.ev_loop, sca_app_loop_release, sca_app_loop_acquire);

 	// Prepare listening control socket(s)


sysrepo UPDATE improve ignored perms message

Refs #2875

--- src/sysrepo.c
+++ src/sysrepo.c
@@ -1838,7 +1838,7 @@
     mod_shm = SR_CONN_MOD_SHM(conn);

     if (perm & SR_UMASK) {
-        SR_LOG_WRN("Ignoring permission bits %03o forbidden by Sysrepo umask.", SR_UMASK);
+        SR_LOG_WRN("Ignoring permission bits %03o forbidden by Sysrepo umask.", perm & SR_UMASK);
         perm &= ~SR_UMASK;
     }
     if (group && strlen(SR_GROUP) && strcmp(group, SR_GROUP)) {


nrf5/bluetooth: Updating bluetooth le driver to compile with s132 v.2.0.1 stack.

--- nrf5/bluetooth/ble_drv.c
+++ nrf5/bluetooth/ble_drv.c
@@ -223,10 +223,10 @@
     SD_TEST_OR_ENABLE();

     ble_gap_addr_t local_ble_addr;
-#if (BLUETOOTH_SD != 132)
+#if (BLUETOOTH_SD == 132 && BLE_API_VERSION == 3)
+    uint32_t err_code = sd_ble_gap_addr_get(&local_ble_addr);
+#else
     uint32_t err_code = sd_ble_gap_address_get(&local_ble_addr);
-#else
-    uint32_t err_code = sd_ble_gap_addr_get(&local_ble_addr);
 #endif

     if (err_code != 0) {
@@ -694,7 +694,7 @@
 #if (BLUETOOTH_SD == 130)
     scan_params.selective   = 0;
     scan_params.p_whitelist = NULL;
-#else
+#elif (BLUETOOTH_SD == 132 && BLE_API_VERSION == 3)
     scan_params.use_whitelist = 0;
 #endif

@@ -721,7 +721,7 @@
 #if (BLUETOOTH_SD == 130)
     scan_params.selective   = 0;
     scan_params.p_whitelist = NULL;
-#else
+#elif (BLUETOOTH_SD == 132 && BLE_API_VERSION == 3)
     scan_params.use_whitelist = 0;
 #endif

@@ -857,7 +857,7 @@
             (void)sd_ble_gatts_sys_attr_set(p_ble_evt->evt.gatts_evt.conn_handle, NULL, 0, 0);
             break;

-#if (BLUETOOTH_SD == 132)
+#if (BLUETOOTH_SD == 132 && BLE_API_VERSION == 3)
         case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
             BLE_DRIVER_LOG("GATTS EVT EXCHANGE MTU REQUEST\n");
             (void)sd_ble_gatts_exchange_mtu_reply(p_ble_evt->evt.gatts_evt.conn_handle, 23); // MAX MTU size


refactor candidate node sending

refactor candidate node sending

20060512172201-b59df-9f94a65840ff4c2b8af4a9d10640a2d102c39d9d.gz

--- src/gabble-media-stream.c
+++ src/gabble-media-stream.c
@@ -800,6 +800,29 @@
 }

 static void
+push_candidate (GabbleMediaStream *stream, GValueArray *candidate)
+{
+  LmMessage *msg;
+  LmMessageNode *session_node;
+  GabbleMediaStreamPrivate *priv = GABBLE_MEDIA_STREAM_GET_PRIVATE (stream);
+
+  /* construct a session message */
+  msg = _gabble_media_session_message_new (priv->session, "candidates",
+    &session_node);
+  _add_rtp_candidate_node (priv->session, msg->node, candidate);
+
+  GMS_DEBUG_INFO (priv->session,
+    "sending jingle session action \"candidate\" to peer");
+
+  /* send it */
+  _gabble_connection_send_with_reply (priv->conn, msg,
+    candidates_msg_reply_cb, G_OBJECT (stream), NULL, NULL);
+
+  /* clean up */
+  lm_message_unref (msg);
+}
+
+static void
 push_native_candidates (GabbleMediaStream *stream)
 {
   GabbleMediaStreamPrivate *priv;
@@ -820,27 +843,10 @@
   candidates = g_value_get_boxed (&priv->native_candidates);

   for (i = 0; i < candidates->len; i++)
-    {
-      GValueArray *candidate;
-      LmMessage *msg;
-      LmMessageNode *session_node;
-
-      /* construct a session message */
-      msg = _gabble_media_session_message_new (priv->session, "candidates", &session_node);
-      candidate = g_ptr_array_index (candidates, i);
-      _add_rtp_candidate_node (priv->session, msg->node, candidate);
-
-      GMS_DEBUG_INFO (priv->session, "sending jingle session action \"candidate\" to peer");
-
-      /* send it */
-      _gabble_connection_send_with_reply (priv->conn, msg, candidates_msg_reply_cb, G_OBJECT (stream), NULL, NULL);
-
-      /* clean up */
-      lm_message_unref (msg);
-    }
+    push_candidate (stream, g_ptr_array_index (candidates, i));

   g_value_take_boxed (&priv->native_candidates,
-      dbus_g_type_specialized_construct (TP_TYPE_CANDIDATE_LIST));
+    dbus_g_type_specialized_construct (TP_TYPE_CANDIDATE_LIST));
 }

 gboolean


Show total number of bytes allocated.

Show total number of bytes allocated.

--- tools/dfbdump.c
+++ tools/dfbdump.c
@@ -471,6 +471,7 @@

      if (argc > 1 && !strcmp( argv[1], "-s" )) {
           unsigned int i;
+          unsigned int total = 0;

           DFB_ASSERT( _sheap != NULL );

@@ -482,9 +483,13 @@
                for (i=0; i<_sheap->alloc_count; i++) {
                     SHMemDesc *d = &_sheap->alloc_list[i];

-                    printf( "   %7d bytes at %p allocated in %s (%s: %u)\n",
+                    printf( " %9d bytes at %p allocated in %s (%s: %u)\n",
                             d->bytes, d->mem, d->func, d->file, d->line );
+
+                    total += d->bytes;
                }
+
+               printf( "   -------\n  %7dk total\n", total >> 10 );
           }

           fusion_skirmish_dismiss( &_sheap->lock );


(elliptic/heat) swap pointers to update solution

--- applications/elliptic/heat/heat_run.c
+++ applications/elliptic/heat/heat_run.c
@@ -182,7 +182,7 @@
             fclaw2d_elliptic_solve(glob);

             /* swap pointers between RHS and q */
-            //heat_run_swap_rhs_q(glob);
+            heat_run_swap_rhs_q(glob);

             double tc = t_curr + dt_step;
             fclaw_global_productionf("Level %d (%d-%d) step %5d : dt = %12.3e; Final time = %12.4f\n",


Update reference URL in CoreData comments

--- nsrails/Source/NSRails.h
+++ nsrails/Source/NSRails.h
@@ -34,7 +34,8 @@

 // Uncomment the line above if you want to enable CoreData
 // You can also add NSR_USE_COREDATA to "Preprocessor Macros Not Used in Precompiled Headers" in your target's build settings
-//   See http://dingbat.github.com/nsrails/Classes/NSRRemoteObject.html#coredata for more details
+//   See http://dingbat.github.com/nsrails/Classes/NSRRemoteManagedObject.html for more details
+

 // Logging
 // =============


Fix taskbar handling of clients that don't accept input focus.

--- src/taskbar.c
+++ src/taskbar.c
@@ -301,9 +301,6 @@
    for(i = 0; i < LAYER_COUNT; i++) {
       ClientNode *np;
       for(np = nodes[i]; np; np = np->next) {
-         if(!(np->state.status & STAT_CANFOCUS)) {
-            continue;
-         }
          if(!ShouldFocus(np)) {
             continue;
          }
@@ -317,7 +314,12 @@
    for(i = restoreCount - 1; i >= 0; i--) {
       RestoreClient(toRestore[i], 1);
    }
-   FocusClient(toRestore[0]);
+   for(i = 0; i < restoreCount; i++) {
+      if(toRestore[i]->state.status & STAT_CANFOCUS) {
+         FocusClient(toRestore[i]);
+         break;
+      }
+   }
    ReleaseStack(toRestore);
 }


[CellNet] Connect CellNet thread to Secure Storage service

Call le_secStore_ConnectService() function in CellNetThread to
allow calls to secure storage functions in this thread.

Resolves: LE-5696
Change-Id: I17f09e20db58eb00028019080160d218fcddb2f9

--- components/cellNetService/cellNetServiceServer.c
+++ components/cellNetService/cellNetServiceServer.c
@@ -483,6 +483,7 @@
     le_cfg_ConnectService();
     le_mrc_ConnectService();
     le_sim_ConnectService();
+    le_secStore_ConnectService();

     LE_INFO("CellNet Thread Started");


do not lose errors at exit time

do not lose errors at exit time

--- tools/kateenc.c
+++ tools/kateenc.c
@@ -651,7 +651,7 @@

 int main(int argc,char **argv)
 {
-  int n,ret;
+  int n,ret,failed=0;
   const char *input_filename=NULL;
   const char *output_filename=NULL;
   const char *input_file_type=NULL;
@@ -843,21 +843,28 @@
     fprintf(stderr,"Invalid format type: %s\n",input_file_type);
     ret=-1;
   }
+  if (ret<0) failed=ret;

   if (ret==0) {
     ogg_packet op;
     ret=kate_ogg_encode_finish(&k,-1,&op);
     if (ret<0) {
       fprintf(stderr,"error encoding end packet: %d\n",ret);
+      failed=ret;
     }
     else {
       ret=send_packet(fout,&op);
       if (ret<0) {
         fprintf(stderr,"error sending end packet: %d\n",ret);
+        failed=ret;
       }
       else {
         if (!raw) {
           ret=flush_page(fout);
+          if (ret<0) {
+            fprintf(stderr,"error flushing page: %d\n",ret);
+            failed=ret;
+          }
         }
       }
     }
@@ -896,5 +903,5 @@
   print_rle_stats();
 #endif

-  return ret;
-}
+  return failed;
+}


Avoid signed-to-unsigned comparison

Avoid signed-to-unsigned comparison

--- num/__private/literals.h
+++ num/__private/literals.h
@@ -15,7 +15,6 @@
 #pragma once

 #if _MSC_VER
-
 // Workaround for MSVC bug that doesn't constant-evaluate user-defined literals
 // in all cases:
 // https://developercommunity.visualstudio.com/t/User-defined-literals-not-constant-expre/10108165
@@ -26,15 +25,15 @@
 // that triggers a different MSVC bug when used with any unary/binary operator
 // in a templated function:
 // https://developercommunity.visualstudio.com/t/MSVC-Compiler-bug-with:-numeric-literal/10108160
-#define _sus__integer_literal(Name, T, PrimitiveT)              \
-  T inline constexpr operator""_##Name(unsigned long long val) { \
-    ::sus::check(val <= T::MAX_PRIMITIVE);                       \
-    return T(static_cast<decltype(T::primitive_value)>(val));    \
+#define _sus__integer_literal(Name, T, PrimitiveT)                          \
+  T inline constexpr operator""_##Name(unsigned long long val) {            \
+    ::sus::check(val <= static_cast<unsigned long long>(T::MAX_PRIMITIVE)); \
+    return T(static_cast<decltype(T::primitive_value)>(val));               \
   }
 #else
-#define _sus__integer_literal(Name, T, PrimitiveT)              \
+#define _sus__integer_literal(Name, T, PrimitiveT)               \
   T inline consteval operator""_##Name(unsigned long long val) { \
-    if (val > T::MAX_PRIMITIVE)                                  \
+    if (val > static_cast<unsigned long long>(T::MAX_PRIMITIVE)) \
       throw "Integer literal out of bounds for ##T##";           \
     return T(static_cast<decltype(T::primitive_value)>(val));    \
   }


suppression du const qui empèche la compilation

--- src/testApp.h
+++ src/testApp.h
@@ -33,7 +33,7 @@
 	void gotMessage(ofMessage msg);
 	vector<ofxMarking *> contourPainting();
 	ofColor filterColor(int x,int y,int width_filter);
-	void onGifSaved(const std::string &fileName);
+	void onGifSaved(std::string &fileName);

 	bool internet;


attempted compile #1

attempted compile #1

--- src/texture.c
+++ src/texture.c
@@ -310,7 +310,7 @@
   Texture* texture;
   Data_Get_Struct(rbTexture, Texture, texture);

-  if (bitDepth == 16) {
+  if (bitDepth == 16) { //png_infop
     png_set_strip_16(pngPtr);
   }
   if (colorType == PNG_COLOR_TYPE_PALETTE && !hasPalette) {
@@ -325,20 +325,37 @@
   if (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8) {
     png_set_expand_gray_1_2_4_to_8(pngPtr);
   }
+
   png_read_update_info(pngPtr, infoPtr);
-  if (0 < infoPtr->num_palette && hasPalette) {
+
+  png_colorp cppalette;
+  int num_palette;
+
+  png_get_PLTE(pngPtr, infoPtr, &cppalette,
+                     &num_palette);
+
+  if (0 < (num_palette) && hasPalette) {
     texture->indexes = ALLOC_N(uint8_t, width * height);
-    const png_colorp palette = infoPtr->palette;
-    const int numTrans = infoPtr->num_trans;
-#if PNG_LIBPNG_VER_SONUM <= 12
-    const png_bytep trans = infoPtr->trans;
-#else
-    const png_bytep trans = infoPtr->trans_alpha;
-#endif
-    texture->paletteSize = infoPtr->num_palette;
+
+    int numTrans;
+    png_colorp trans_color;
+    png_bytep trans;
+
+    png_get_tRNS(pngPtr, infoPtr, &trans, &numTrans, &trans_color);
+
+    //const int numTrans = infoPtr->num_trans;
+//#if PNG_LIBPNG_VER_SONUM <= 12
+//    const png_bytep trans = infoPtr->trans;
+//#else
+//    const png_bytep trans = infoPtr->trans_alpha;
+//#endif
+
+    texture->paletteSize = num_palette;
+
     Color* p = texture->palette = ALLOC_N(Color, texture->paletteSize);
+
     for (int i = 0; i < texture->paletteSize; i++, p++) {
-      const png_colorp pngColorP = &(palette[i]);
+      const png_colorp pngColorP = &(cppalette[i]);
       p->red   = pngColorP->red;
       p->green = pngColorP->green;
       p->blue  = pngColorP->blue;
@@ -351,6 +368,7 @@
       }
     }
   }
+
   const int channels = png_get_channels(pngPtr, infoPtr);
   const Color* palette = texture->palette;
   uint8_t* indexes = texture->indexes;


win32_menu: add missing parentheses in mapMenu()

`|' has higher precedence than `?'.

Signed-off-by: Roel Kluin <aa9c6213291cec1ff07688554fb7b904b9ffe4e3@gmail.com>
Signed-off-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>

--- src/glut/glx/win32_menu.c
+++ src/glut/glx/win32_menu.c
@@ -97,7 +97,7 @@
 mapMenu(GLUTmenu * menu, int x, int y)
 {
   TrackPopupMenu((HMENU) menu->win, TPM_LEFTALIGN |
-    (__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON,
+    ((__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON),
     x, y, 0, __glutCurrentWindow->win, NULL);
 }


DOC: change documentation

DOC: change documentation

--- common/vtkObjectFactory.h
+++ common/vtkObjectFactory.h
@@ -98,9 +98,10 @@

   // Description:
   // All sub-classes of vtkObjectFactory should must return the version of
-  // VTK they were built with.  This should be implemented with a call to
-  // vtkVersion::GetVTKSourceVersion.  This is critical to determine
-  // possible incompatible dynamic factory loads.
+  // VTK they were built with.  This should be implemented with the macro
+  // VTK_SOURCE_VERSION and NOT a call to vtkVersion::GetVTKSourceVersion.
+  // As the version needs to be compiled into the file as a string constant.
+  // This is critical to determine possible incompatible dynamic factory loads.
   virtual const char* GetVTKSourceVersion() = 0;
 protected:
   // Description:


updated version string.

updated version string.

--- src/tglobal.h
+++ src/tglobal.h
@@ -1,7 +1,7 @@
 #pragma once
 constexpr auto TF_VERSION_STR = "2.3.0";
 constexpr auto TF_VERSION_NUMBER = 0x020300;
-constexpr auto TF_SRC_REVISION = 2462;
+constexpr auto TF_SRC_REVISION = 2467;

 #include <QMetaType>
 #include <QIODevice>


Fixed the hash key comparison function.
Review URL: https://codereview.appspot.com/7378065

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@7853 2bbb7eff-a529-9590-31e7-b0007b416f81

--- src/gpu/GrResourceCache.h
+++ src/gpu/GrResourceCache.h
@@ -132,7 +132,7 @@

     struct Key {
         int compare(const HashedKey& hashedKey) const {
-            return fHashedKey.compare(fHashedKey);
+            return fHashedKey.compare(hashedKey);
         }

         HashedKey fHashedKey;


* message forward first cleanups...

* message forward first cleanups...

pmo-trunk-r160

--- src/gtk-glade/modest-ui.c
+++ src/gtk-glade/modest-ui.c
@@ -70,8 +70,17 @@

 static void register_toolbar_callbacks (ModestUI *modest_ui);

-static void reply_to_msg (ModestUI *modest_ui, TnyMsgHeaderIface *header,
-						ModestTnyMsgView *msg_view);
+
+typedef enum {
+	QUOTED_SEND_REPLY,
+	QUOTED_SEND_REPLY_ALL,
+	QUOTED_SEND_FORWARD
+} quoted_send_type;
+
+static void quoted_send_msg (ModestUI *modest_ui, TnyMsgHeaderIface *header,
+						ModestTnyMsgView *msg_view, quoted_send_type qstype);
+
+

 /* list my signals */
 enum {
@@ -109,6 +118,7 @@
 	return my_type;
 }

+
 static void
 modest_ui_class_init (ModestUIClass *klass)
 {
@@ -128,6 +138,7 @@
 /* 	etc. */
 }

+
 static void
 modest_ui_init (ModestUI *obj)
 {
@@ -141,6 +152,7 @@

 }

+
 static void
 modest_ui_finalize (GObject *obj)
 {
@@ -162,6 +174,7 @@
 		g_object_unref (priv->modest_window_mgr);
 	priv->modest_window_mgr = NULL;
 }
+

 GObject*
 modest_ui_new (ModestConf *modest_conf)
@@ -773,13 +786,6 @@
 }

-typedef enum {
-	QUOTED_SEND_REPLY,
-	QUOTED_SEND_REPLY_ALL,
-	QUOTED_SEND_FORWARD
-} quoted_send_type;
-
-
 static void
 quoted_send_msg (ModestUI *modest_ui, TnyMsgHeaderIface *header,
 						ModestTnyMsgView *msg_view, quoted_send_type qstype) {


Make argvSetup overridable

Make argvSetup overridable

--- nx/source/runtime/argv.c
+++ nx/source/runtime/argv.c
@@ -20,7 +20,7 @@

 void nxlinkSetup(void);

-void argvSetup(void)
+void __attribute__((weak)) argvSetup(void)
 {
     Result rc=0;
     MemoryInfo meminfo;


Remove todo comment from symbol.h.

Remove todo comment from symbol.h.

--- compiler/include/symbol.h
+++ compiler/include/symbol.h
@@ -129,9 +129,6 @@
   const char*        cname;    // Name of symbol for C code

   DefExpr*           defPoint; // Point of definition
-
-  // TODO: Add this in! (thomasvandoren, 2015-02-21)
-  //virtual void printDocs(std::ostream *file, unsigned int tabs);

 protected:
                      Symbol(AstTag      astTag,


obexd: Add offset parameter decription

obexd: Add offset parameter decription

Add offset parameter description for
messages_get_messages_listing() function header

--- obexd/plugins/messages.h
+++ obexd/plugins/messages.h
@@ -215,6 +215,7 @@
  * session: Backend session.
  * name: Optional subdirectory name.
  * max: Maximum number of entries to retrieve.
+ * offset: Offset of the first entry.
  * filter: Filter to apply on returned message listing.
  * size: Total size of listing to be returned.
  * newmsg: Indicates presence of unread messages.


Fix whitespace and indentation issues

Fix whitespace and indentation issues

--- tools/mcetool.c
+++ tools/mcetool.c
@@ -1089,13 +1089,13 @@
  */
 static gboolean dbushelper_read_variant(DBusMessageIter *iter, DBusMessageIter *sub)
 {
-  if( !dbushelper_require_type(iter, DBUS_TYPE_VARIANT) )
-  return FALSE;
-
-  dbus_message_iter_recurse(iter, sub);
-  dbus_message_iter_next(iter);
-
-  return TRUE;
+	if( !dbushelper_require_type(iter, DBUS_TYPE_VARIANT) )
+		return FALSE;
+
+	dbus_message_iter_recurse(iter, sub);
+	dbus_message_iter_next(iter);
+
+	return TRUE;
 }

 /** Helper for entering array container from D-Bus message iterator
@@ -1160,11 +1160,11 @@
 static gboolean dbushelper_init_read_iterator(DBusMessage *rsp,
 					      DBusMessageIter *iter)
 {
-  if( !dbus_message_iter_init(rsp, iter) ) {
-    fprintf(stderr, "failed to initialize dbus read iterator\n");
-    return FALSE;
-  }
-  return TRUE;
+	if( !dbus_message_iter_init(rsp, iter) ) {
+		fprintf(stderr, "failed to initialize dbus read iterator\n");
+		return FALSE;
+	}
+	return TRUE;
 }

 /** Helper for initializing D-Bus message write iterator
@@ -2346,7 +2346,6 @@
 		g_free(vec);
 	}

-
 EXIT:
 	fprintf(stdout, "\n");

@@ -2362,7 +2361,6 @@
 	/** Value of the symbol */
 	int         val;
 } symbol_t;
-

 /** Lookup symbol by name and return value
  *


Added "%" and "%=" operator support

Added "%" and "%=" operator support

--- compiler/native/src/njs.h
+++ compiler/native/src/njs.h
@@ -496,8 +496,17 @@
 			else if(type == __NJS_STRING && _v1.type == __NJS_NUMBER) REGISTER[_ptr].s->__NJS_VALUE += _v1.get().i;
 			return __NJS_VAR();
 		}
+
+		__NJS_VAR operator-=(const __NJS_VAR _v1)
+		{
+			if(type == __NJS_NUMBER && _v1.type == __NJS_NUMBER) REGISTER[_ptr].i -= _v1.get().i;
+			else if(type == __NJS_NUMBER && _v1.type == __NJS_DOUBLE) REGISTER[_ptr].i -= _v1.get().d;
+			else if(type == __NJS_DOUBLE && _v1.type == __NJS_NUMBER) REGISTER[_ptr].d -= _v1.get().i;
+			else if(type == __NJS_DOUBLE && _v1.type == __NJS_DOUBLE) REGISTER[_ptr].d -= _v1.get().d;
+			return __NJS_VAR();
+		}

-   	 __NJS_VAR operator++(const int _v1)
+	   	__NJS_VAR operator++(const int _v1)
 		{
 			if(type == __NJS_NUMBER) REGISTER[_ptr].i++;
 			else if(type == __NJS_DOUBLE) REGISTER[_ptr].d++;
@@ -542,9 +551,22 @@
 			else if(type == __NJS_DOUBLE && _v1.type == __NJS_DOUBLE) return __NJS_VAR( get().d / _v1.get().d );
 			return __NJS_VAR();
 		}
-    __NJS_VAR operator%(const __NJS_VAR& _v1)
-		{
-			return __NJS_VAR( get().i % _v1.get().i );
+	    __NJS_VAR operator%(const __NJS_VAR& _v1)
+		{
+			if(type == __NJS_NUMBER && _v1.type == __NJS_NUMBER) return __NJS_VAR( get().i % _v1.get().i );
+			else if(type == __NJS_NUMBER && _v1.type == __NJS_DOUBLE) return __NJS_VAR( get().i % (int)_v1.get().d );
+			else if(type == __NJS_DOUBLE && _v1.type == __NJS_NUMBER) return __NJS_VAR( (int)get().d % _v1.get().i );
+			else if(type == __NJS_DOUBLE && _v1.type == __NJS_DOUBLE) return __NJS_VAR( (int)get().d % (int)_v1.get().d );
+			return __NJS_VAR();
+		}
+
+		__NJS_VAR operator%=(const __NJS_VAR& _v1)
+		{
+			if(type == __NJS_NUMBER && _v1.type == __NJS_NUMBER) REGISTER[_ptr].i %= _v1.get().i;
+			else if(type == __NJS_NUMBER && _v1.type == __NJS_DOUBLE) REGISTER[_ptr].i %= (int)_v1.get().d;
+			else if(type == __NJS_DOUBLE && _v1.type == __NJS_NUMBER) REGISTER[_ptr].d = (int)REGISTER[_ptr].d % _v1.get().i;
+			else if(type == __NJS_DOUBLE && _v1.type == __NJS_DOUBLE) REGISTER[_ptr].d = (int)REGISTER[_ptr].d % (int)_v1.get().d;
+			return __NJS_VAR();
 		}

     __NJS_VAR const operator! () const