auhal: add support for 8.0 and 8.1 output (close #8536)

--- modules/audio_output/auhal.c
+++ modules/audio_output/auhal.c
@@ -554,6 +554,28 @@
     memset (&new_layout, 0, sizeof(new_layout));
     uint32_t chans_out[AOUT_CHAN_MAX];

+    /* Some channel abbreviations used below:
+     * L - left
+     * R - right
+     * C - center
+     * Ls - left surround
+     * Rs - right surround
+     * Cs - center surround
+     * Rls - rear left surround
+     * Rrs - rear right surround
+     * Lw - left wide
+     * Rw - right wide
+     * Lsd - left surround direct
+     * Rsd - right surround direct
+     * Lc - left center
+     * Rc - right center
+     * Ts - top surround
+     * Vhl - vertical height left
+     * Vhc - vertical height center
+     * Vhr - vertical height right
+     * Lt - left matrix total. for matrix encoded stereo.
+     * Rt - right matrix total. for matrix encoded stereo. */
+
     switch(aout_FormatNbChannels(fmt)) {
         case 1:
             new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_Mono;
@@ -588,7 +610,7 @@
                 new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_AudioUnit_6_0; // L R Ls Rs C Cs
             break;
         case 7:
-            new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A;
+            new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A; // L R C LFE Ls Rs Cs

             chans_out[0] = AOUT_CHAN_LEFT;
             chans_out[1] = AOUT_CHAN_RIGHT;
@@ -604,21 +626,49 @@

             break;
         case 8:
-            new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A;
-
-            chans_out[0] = AOUT_CHAN_LEFT;
-            chans_out[1] = AOUT_CHAN_RIGHT;
-            chans_out[2] = AOUT_CHAN_CENTER;
-            chans_out[3] = AOUT_CHAN_LFE;
-            chans_out[4] = AOUT_CHAN_MIDDLELEFT;
-            chans_out[5] = AOUT_CHAN_MIDDLERIGHT;
-            chans_out[6] = AOUT_CHAN_REARLEFT;
-            chans_out[7] = AOUT_CHAN_REARRIGHT;
-
+            if (fmt->i_physical_channels & (AOUT_CHAN_LFE)) {
+                new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A; // L R C LFE Ls Rs Lc Rc
+
+                chans_out[0] = AOUT_CHAN_LEFT;
+                chans_out[1] = AOUT_CHAN_RIGHT;
+                chans_out[2] = AOUT_CHAN_CENTER;
+                chans_out[3] = AOUT_CHAN_LFE;
+                chans_out[4] = AOUT_CHAN_MIDDLELEFT;
+                chans_out[5] = AOUT_CHAN_MIDDLERIGHT;
+                chans_out[6] = AOUT_CHAN_REARLEFT;
+                chans_out[7] = AOUT_CHAN_REARRIGHT;
+            } else {
+                new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_DTS_8_0_B; // Lc C Rc L R Ls Cs Rs
+
+                chans_out[0] = AOUT_CHAN_MIDDLELEFT;
+                chans_out[1] = AOUT_CHAN_CENTER;
+                chans_out[2] = AOUT_CHAN_MIDDLERIGHT;
+                chans_out[3] = AOUT_CHAN_LEFT;
+                chans_out[4] = AOUT_CHAN_RIGHT;
+                chans_out[5] = AOUT_CHAN_REARLEFT;
+                chans_out[6] = AOUT_CHAN_REARCENTER;
+                chans_out[7] = AOUT_CHAN_REARRIGHT;
+            }
             p_aout->sys->chans_to_reorder = aout_CheckChannelReorder(NULL, chans_out, fmt->i_physical_channels, p_aout->sys->chan_table);
             if (p_aout->sys->chans_to_reorder)
-                msg_Dbg(p_aout, "channel reordering needed for 7.1 output");
-
+                msg_Dbg(p_aout, "channel reordering needed for 7.1 / 8.0 output");
+
+            break;
+        case 9:
+            new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_DTS_8_1_B; // Lc C Rc L R Ls Cs Rs LFE
+            chans_out[0] = AOUT_CHAN_MIDDLELEFT;
+            chans_out[1] = AOUT_CHAN_CENTER;
+            chans_out[2] = AOUT_CHAN_MIDDLERIGHT;
+            chans_out[3] = AOUT_CHAN_LEFT;
+            chans_out[4] = AOUT_CHAN_RIGHT;
+            chans_out[5] = AOUT_CHAN_REARLEFT;
+            chans_out[6] = AOUT_CHAN_REARCENTER;
+            chans_out[7] = AOUT_CHAN_REARRIGHT;
+            chans_out[8] = AOUT_CHAN_LFE;
+
+            p_aout->sys->chans_to_reorder = aout_CheckChannelReorder(NULL, chans_out, fmt->i_physical_channels, p_aout->sys->chan_table);
+            if (p_aout->sys->chans_to_reorder)
+                msg_Dbg(p_aout, "channel reordering needed for 8.1 output");
             break;
     }


Added another warning to GLES renderer about max texture size

--- project/jni/sdl-1.3/src/video/SDL_renderer_gles.c
+++ project/jni/sdl-1.3/src/video/SDL_renderer_gles.c
@@ -500,8 +500,10 @@
     data->texw = (GLfloat) texture->w / texture_w;
     data->texh = (GLfloat) texture->h / texture_h;
     if( renderer->info.max_texture_width < texture_w || renderer->info.max_texture_height < texture_h )
-        __android_log_print(ANDROID_LOG_FATAL, "libSDL", "GLES: Allocated texture of size %dx%d which is bigger than largest possible device texture %dx%d",
+        __android_log_print(ANDROID_LOG_WARNING, "libSDL", "GLES: Allocated texture of size %dx%d which is bigger than largest possible device texture %dx%d",
                             texture_w, texture_h, renderer->info.max_texture_width, renderer->info.max_texture_height );
+    else if( texture_w > 1024 || texture_h > 1024 )
+        __android_log_print(ANDROID_LOG_WARNING, "libSDL", "GLES: Allocated texture of size %dx%d which is bigger than 1024x1024 - this code will not work on HTC G1", texture_w, texture_h );

     data->format = format;
     data->formattype = type;


wrong parameters to msync(), causing it to fail when trying to mark old data file deleted.

--- src/lib-index/mail-index-data.c
+++ src/lib-index/mail-index-data.c
@@ -358,7 +358,7 @@
 		return TRUE;

 	data->header->indexid = 0;
-	if (msync(data->mmap_base, 0, sizeof(MailIndexDataHeader)) < 0)
+	if (msync(data->mmap_base, sizeof(MailIndexDataHeader), MS_SYNC) < 0)
 		return index_data_set_syscall_error(data, "msync()");

 	return TRUE;


* faad: better support of AAC without ESDS.

--- modules/codec/faad/decoder.c
+++ modules/codec/faad/decoder.c
@@ -2,7 +2,7 @@
  * decoder.c: AAC decoder using libfaad2
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: decoder.c,v 1.22 2003/03/30 18:14:36 gbazin Exp $
+ * $Id: decoder.c,v 1.23 2003/05/09 19:53:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -208,6 +208,14 @@
         int i_frame_size;
         pes_packet_t *p_pes;

+        faacDecConfigurationPtr cfg;
+
+        cfg = faacDecGetCurrentConfiguration( p_adec->p_handle );
+        if( p_wf->nSamplesPerSec > 0 )
+        {
+            cfg->defSampleRate = p_wf->nSamplesPerSec;
+        }
+        faacDecSetConfiguration( p_adec->p_handle, cfg );
         msg_Warn( p_adec->p_fifo,
                  "DecoderSpecificInfo missing, trying with first frame" );
         // gather first frame


index fsck: Don't give bogus "duplicate extension" errors and break them.

--HG--
branch : HEAD

--- src/lib-index/mail-index-fsck.c
+++ src/lib-index/mail-index-fsck.c
@@ -298,6 +298,7 @@
 							 &next_offset);
 			}
 			array_append(&names, &name, 1);
+			offset = next_offset;
 			continue;
 		}

@@ -307,7 +308,6 @@
 			    map->hdr_copy_buf, next_offset, (size_t)-1);
 		buffer_set_used_size(map->hdr_copy_buf, hdr->header_size);
 		map->hdr_base = map->hdr_copy_buf->data;
-		next_offset = offset;
 	}
 }


codec/schroedinger: don't bother doing any complicated timestamp interpolation

The packetizer does a far more thorough job of handling the different
timestamp representations used by vlc

Signed-off-by: David Flynn <38ae1b48ed96d57c9e166f6cc6ffdf619b4856ab@rd.bbc.co.uk>
Signed-off-by: Jean-Baptiste Kempf <7b85a41a628204b76aba4326273a3ccc74bd009a@videolan.org>

--- modules/codec/schroedinger.c
+++ modules/codec/schroedinger.c
@@ -290,7 +290,6 @@
 static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
-    uint32_t u_pnum;

     if( !pp_block ) return NULL;

@@ -356,7 +355,6 @@

         case SCHRO_DECODER_OK: {
             SchroTag *p_tag = schro_decoder_get_picture_tag( p_sys->p_schro );
-            u_pnum = schro_decoder_get_picture_number( p_sys->p_schro );
             p_schroframe = schro_decoder_pull( p_sys->p_schro );
             if( !p_schroframe->priv )
             {
@@ -369,23 +367,20 @@
             p_pic = ((struct picture_free_t*) p_schroframe->priv)->p_pic;
             p_schroframe->priv = NULL;

-            /* solve presentation time stamp for picture.  If this picture
-             * was not tagged with a pts when presented to decoder, interpolate
-             * one
-             * This means no need to set p_pic->b_force, as we have a pts on
-             * each picture */
             if( p_tag )
             {
                 /* free is handled by schro_frame_unref */
                 p_pic->date = *(mtime_t*) p_tag->value;
                 schro_tag_free( p_tag );
-                msg_Err(p_dec, "pts out: %"PRId64, p_pic->date);
             }
             else if( p_sys->i_lastpts >= 0 )
             {
+                /* NB, this shouldn't happen since the packetizer does a
+                 * very thorough job of inventing timestamps.  The
+                 * following is just a very rough fall back incase packetizer
+                 * is missing. */
+                /* maybe it would be better to set p_pic->b_force ? */
                 p_pic->date = p_sys->i_lastpts + p_sys->i_frame_pts_delta;
-                /* fixme */
-                msg_Err(p_dec, "no pts");
             }
             p_sys->i_lastpts = p_pic->date;


Code cleanup

Code cleanup

--- src/lib-index/mail-index-sync.c
+++ src/lib-index/mail-index-sync.c
@@ -698,11 +698,25 @@
 		ctx->ext_trans->log_updates = TRUE;
 }

+static bool mail_index_sync_want_index_write(struct mail_index *index)
+{
+	uint32_t log_diff;
+
+	log_diff = index->map->hdr.log_file_tail_offset -
+		index->last_read_log_file_tail_offset;
+	if (log_diff > 1024)
+		return TRUE;
+
+	if (index->need_recreate)
+		return TRUE;
+	return FALSE;
+}
+
 int mail_index_sync_commit(struct mail_index_sync_ctx **_ctx)
 {
         struct mail_index_sync_ctx *ctx = *_ctx;
 	struct mail_index *index = ctx->index;
-	uint32_t seq, diff, next_uid;
+	uint32_t seq, next_uid;
 	uoff_t offset;
 	bool want_rotate;
 	int ret = 0;
@@ -736,11 +750,9 @@
 	if (mail_index_map(ctx->index, MAIL_INDEX_SYNC_HANDLER_FILE) <= 0)
 		ret = -1;

-	/* FIXME: create a better rule? */
 	want_rotate = mail_transaction_log_want_rotate(index->log);
-	diff = index->map->hdr.log_file_tail_offset -
-		index->last_read_log_file_tail_offset;
-	if (ret == 0 && (diff > 1024 || want_rotate || index->need_recreate)) {
+	if (ret == 0 &&
+	    (want_rotate || mail_index_sync_want_index_write(index))) {
 		index->need_recreate = FALSE;
 		mail_index_write(index, want_rotate);
 	}


mail_index_sync_have_any(): Refresh index to see if there are any new unseen changes before returning anything.

--- src/lib-index/mail-index-sync.c
+++ src/lib-index/mail-index-sync.c
@@ -525,6 +525,8 @@
 	struct mail_index_view *view;
 	bool ret;

+	(void)mail_index_refresh(index);
+
 	view = mail_index_view_open(index);
 	ret = mail_index_sync_view_have_any(view, flags);
 	mail_index_view_close(&view);


Don't crash if syncing breaks.

Don't crash if syncing breaks.

--- src/lib-index/mail-index-sync.c
+++ src/lib-index/mail-index-sync.c
@@ -622,7 +622,8 @@
 	*_ctx = NULL;
 	mail_index_unlock(ctx->index, ctx->lock_id);

-	i_assert(!ctx->index->map->write_to_disk);
+	i_assert(ctx->index->map == NULL ||
+		 !ctx->index->map->write_to_disk);
 	mail_transaction_log_sync_unlock(ctx->index->log);

 	mail_index_view_close(&ctx->view);
@@ -675,8 +676,11 @@
 		}
 	}

-	index->sync_log_file_seq = index->map->hdr.log_file_seq;
-	index->sync_log_file_offset = index->map->hdr.log_file_int_offset;
+	if (ret == 0) {
+		index->sync_log_file_seq = index->map->hdr.log_file_seq;
+		index->sync_log_file_offset =
+			index->map->hdr.log_file_int_offset;
+	}

 	mail_index_sync_end(_ctx);
 	return ret;


lib-master: Don't try to close config fd early after all.
Login processes can do another config lookup when TLS hostname is given.

--HG--
branch : HEAD

--- src/lib-master/master-service.c
+++ src/lib-master/master-service.c
@@ -640,7 +640,6 @@
 {
 	struct master_service *service = l->service;
 	struct master_service_connection conn;
-	bool close_config;

 	if (service->master_status.available_count == 0) {
 		/* we are full. stop listening for now, unless overflow
@@ -682,22 +681,12 @@
 	conn.ssl = l->ssl;
 	net_set_nonblock(conn.fd, TRUE);

-	if (service->login_connections)
-		close_config = FALSE;
-	else {
+	if (!service->login_connections) {
 		i_assert(service->master_status.available_count > 0);
 		service->master_status.available_count--;
 		master_status_update(service);
-		close_config = service->master_status.available_count == 0 &&
-			service->service_count_left == 1;
-	}
-
+	}
 	service->callback(&conn);
-
-	if (close_config) {
-		/* we're dying as soon as this connection closes. */
-		master_service_close_config_fd(service);
-	}
 }

 static void io_listeners_init(struct master_service *service)


fix #3 Fix the logic when initialize initialize_expect_ping event. I did this modification by following the logic of initialize_leader_ping. After solving this problem, the expriment on 3 seperate machines successfully returns the result of ab.

--- src/replica-sys/replica.c
+++ src/replica-sys/replica.c
@@ -281,15 +281,15 @@
 static int initialize_expect_ping(node* my_node){
     if(NULL==my_node->ev_expect_ping){
         my_node->ev_expect_ping = evtimer_new(my_node->base,expected_leader_ping_period,(void*)my_node);
-        if(my_node->ev_leader_ping==NULL){
+        if(my_node->ev_expect_ping==NULL){
             return 1;
         }
     }
     if(NULL!=my_node->ev_leader_ping){
         evtimer_del(my_node->ev_leader_ping);
     }
-    evtimer_del(my_node->ev_expect_ping);
-    evtimer_add(my_node->ev_leader_ping,&my_node->config.expect_ping_timeval);
+
+    evtimer_add(my_node->ev_expect_ping,&my_node->config.expect_ping_timeval);
     CHECK_EXIT
     return 0;
 }


close #2 When we find out the event pointer is null, we don't neeed to delete it.

--- src/replica-sys/replica.c
+++ src/replica-sys/replica.c
@@ -273,7 +273,6 @@
     if(NULL!=my_node->ev_expect_ping){
         evtimer_del(my_node->ev_expect_ping);
     }
-    evtimer_del(my_node->ev_expect_ping);
     evtimer_add(my_node->ev_leader_ping,&my_node->config.ping_timeval);
     CHECK_EXIT
     return 0;


cache: add implementation for cache-less systems

Add NOP functions to allow writing cache-availabiliy-agnostic code.

Change-Id: Id8e392271329095abad3db6856a4e621702d1dae
Signed-off-by: Benjamin Walsh <578db18f23ec223e50c404886c947386478a464e@windriver.com>

--- include/cache.h
+++ include/cache.h
@@ -23,8 +23,9 @@
 extern "C" {
 #endif

+#define _sys_cache_flush_sig(x) void (x)(vaddr_t virt, size_t size)
+
 #if defined(CONFIG_CACHE_FLUSHING)
-#define _sys_cache_flush_sig(x) void (x)(vaddr_t virt, size_t size)

 #if defined(CONFIG_ARCH_CACHE_FLUSH_DETECT)
 	typedef _sys_cache_flush_sig(_sys_cache_flush_t);
@@ -32,12 +33,34 @@
 #else
 	extern _sys_cache_flush_sig(sys_cache_flush);
 #endif
+
+#else
+
+/*
+ * Provide NOP APIs for systems that do not have caches.
+ *
+ * An example is the Cortex-M chips. However, the functions are provided so
+ * that code that need to manipulate caches can be written in an
+ * architecture-agnostic manner. The functions do nothing. The cache line size
+ * value is always 0.
+ */
+
+static inline _sys_cache_flush_sig(sys_cache_flush)
+{
+	ARG_UNUSED(virt);
+	ARG_UNUSED(size);
+
+	/* do nothing */
+}
+
 #endif /* CACHE_FLUSHING */

 #if defined(CONFIG_CACHE_LINE_SIZE_DETECT)
 	extern size_t sys_cache_line_size;
+#elif defined(CONFIG_CACHE_LINE_SIZE)
+	#define sys_cache_line_size CONFIG_CACHE_LINE_SIZE
 #else
-	#define sys_cache_line_size CONFIG_CACHE_LINE_SIZE
+	#define sys_cache_line_size 0
 #endif

 #ifdef __cplusplus


Add missing CNMEM_API

Add missing CNMEM_API

--- include/cnmem.h
+++ include/cnmem.h
@@ -249,7 +249,7 @@
 /**
  * \brief Converts a cnmemStatus_t value to a string.
  */
-const char* cnmemGetErrorString(cnmemStatus_t status);
+const char* CNMEM_API cnmemGetErrorString(cnmemStatus_t status);

 /* ********************************************************************************************* */


Fixed a signal-handling bug that could cause whatnow to sometimes exit without prompting the user. Based on a patch by Richard Geiger <rmg@netapp.com>.

--- sbr/pidwait.c
+++ sbr/pidwait.c
@@ -18,6 +18,7 @@
 {
     pid_t pid;
     sigset_t set, oset;
+    SIGNAL_HANDLER istat, qstat;

 #ifdef WAITINT
     int status;
@@ -26,11 +27,9 @@
 #endif

     if (sigsok == -1) {
-	/* block a couple of signals */
-	sigemptyset (&set);
-	sigaddset (&set, SIGINT);
-	sigaddset (&set, SIGQUIT);
-	SIGPROCMASK (SIG_BLOCK, &set, &oset);
+	/* ignore a couple of signals */
+	istat = SIGNAL (SIGINT, SIG_IGN);
+	qstat = SIGNAL (SIGQUIT, SIG_IGN);
     }

 #ifdef HAVE_WAITPID
@@ -41,8 +40,9 @@
 #endif

     if (sigsok == -1) {
-	/* reset the signal mask */
-	SIGPROCMASK (SIG_SETMASK, &oset, &set);
+	/* reset the signal handlers */
+	SIGNAL (SIGINT, istat);
+	SIGNAL (SIGQUIT, qstat);
     }

 #ifdef WAITINT


oops

oops

git-svn-id: 70cf712206e5b8426a8d7451e052914a94f8fa22@10737 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/lib/ecore_evas/ecore_evas.c
+++ src/lib/ecore_evas/ecore_evas.c
@@ -15,7 +15,8 @@
 int
 ecore_evas_init(void)
 {
-   evas_init ();
+   if (_ecore_evas_init_count == 0)
+	evas_init ();

    return ++_ecore_evas_init_count;
 }


Cleanup warnings when building without support for the X fixes extension.

git-svn-id: 70cf712206e5b8426a8d7451e052914a94f8fa22@27415 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/lib/ecore_x/ecore_x_fixes.c
+++ src/lib/ecore_x/ecore_x_fixes.c
@@ -6,7 +6,9 @@
 #include "Ecore_X.h"

 static int _fixes_available;
+#ifdef ECORE_XFIXES
 static int _fixes_major, _fixes_minor;
+#endif

 void
 _ecore_x_fixes_init(void)
@@ -24,6 +26,7 @@
 #endif
 }

+#ifdef ECORE_XFIXES
 /* I don't know what to call this function. */
 static XRectangle *
 _ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects, int num)
@@ -63,6 +66,7 @@
      }
    return rects;
 }
+#endif

 EAPI Ecore_X_Region
 ecore_x_region_new(Ecore_X_Rectangle *rects, int num)


psa: Export "internally" mbedtls_cipher_info_from_psa

Export "internally" mbedtls_cipher_info_from_psa to be
able to use it in psa_crypto_cipher.c.

Signed-off-by: Ronald Cron <b35ff5b7ca26c4ae9b66b92f2cf34224c8e26b08@arm.com>

--- library/psa_crypto_core.h
+++ library/psa_crypto_core.h
@@ -212,6 +212,22 @@
  */
 psa_status_t mbedtls_to_psa_error( int ret );

+/** Get Mbed TLS cipher information given the cipher algorithm PSA identifier
+ *  as well as the PSA type and size of the key to be used with the cipher
+ *  algorithm.
+ *
+ * \param       alg        PSA cipher algorithm identifier
+ * \param       key_type   PSA key type
+ * \param       key_bits   Size of the key in bits
+ * \param[out]  cipher_id  Mbed TLS cipher algorithm identifier
+ *
+ * \return  The Mbed TLS cipher information of the cipher algorithm.
+ *          \c NULL if the PSA cipher algorithm is not supported.
+ */
+const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa(
+    psa_algorithm_t alg, psa_key_type_t key_type, size_t key_bits,
+    mbedtls_cipher_id_t *cipher_id );
+
 /** Import a key in binary format.
  *
  * \note The signature of this function is that of a PSA driver


Use noexcept on swap

Use noexcept on swap

--- src/lib/math/ec_gfp/curve_gfp.h
+++ src/lib/math/ec_gfp/curve_gfp.h
@@ -169,7 +169,7 @@

 template<> inline
 void swap<Botan::CurveGFp>(Botan::CurveGFp& curve1,
-                           Botan::CurveGFp& curve2)
+                           Botan::CurveGFp& curve2) noexcept
    {
    curve1.swap(curve2);
    }


Added a constructor for drwnPartialAssignment. Makes a partial assignment from a vector of variables and a vector of values, suited for coordinate format (sparse factor usage).

--- src/lib/pgm/drwnVarAssignment.h
+++ src/lib/pgm/drwnVarAssignment.h
@@ -62,6 +62,14 @@
         }
     }

+    //! construct a partial assignment from a partial assignment expressed
+    //! using a vector of variables and a vector of values
+    drwnPartialAssignment(const vector<int>& vars, const vector<int>& vals) {
+        for (int i = 0; i < vars.size(); i++) {
+            this->insert(make_pair(vars[i], vals[i]));
+        }
+    }
+
     //! return the clique of variables over which the partial
     //! assignment is defined
     drwnClique getClique() const {


Add a #define for RTLD_LOCAL as required by the Single Unix Specification.

--- include/dlfcn.h
+++ include/dlfcn.h
@@ -44,6 +44,7 @@
 #define RTLD_NOW	2	/* Bind function calls immediately */
 #define RTLD_MODEMASK	0x3
 #define RTLD_GLOBAL	0x100	/* Make symbols globally available */
+#define RTLD_LOCAL	0	/* Opposite of RTLD_GLOBAL, and the default */

 /*
  * Special handle argument for dlsym().  It causes the search for the


add 'and' command for auto-generating masks

--- src/kartvid.c
+++ src/kartvid.c
@@ -47,8 +47,10 @@
 static void img_free(img_t *);
 inline unsigned int img_coord(img_t *, unsigned int, unsigned int);
 static double img_compare(img_t *, img_t *);
+static void img_and(img_t *, img_t *);

 static int cmd_compare(int, char *[]);
+static int cmd_and(int, char *[]);
 static int cmd_image(int, char *[]);

 static int kv_debug = 0;
@@ -65,6 +67,8 @@
 		status = cmd_compare(argc - 2, argv + 2);
 	else if (strcmp(argv[1], "image") == 0)
 		status = cmd_image(argc - 2, argv + 2);
+	else if (strcmp(argv[1], "and") == 0)
+		status = cmd_and(argc - 2, argv + 2);
 	else
 		errx(EXIT_USAGE, "usage: %s compare file mask", argv[0]);

@@ -136,6 +140,48 @@
 	if (rv == 0)
 		(void) printf("wrote %s\n", argv[1]);

+	return (rv);
+}
+
+static int
+cmd_and(int argc, char *argv[])
+{
+	img_t *image, *mask;
+	FILE *outfp;
+	int rv;
+
+	if (argc < 3) {
+		warnx("missing files");
+		return (EXIT_USAGE);
+	}
+
+	image = img_read(argv[0]);
+	mask = img_read(argv[1]);
+
+	if (mask == NULL || image == NULL) {
+		img_free(image);
+		return (EXIT_FAILURE);
+	}
+
+	if (image->img_width != mask->img_width ||
+	    image->img_height != mask->img_height) {
+		warnx("image dimensions do not match");
+		img_free(image);
+		img_free(mask);
+		return (EXIT_FAILURE);
+	}
+
+	if ((outfp = fopen(argv[2], "w")) == NULL) {
+		warn("fopen %", argv[1]);
+		img_free(image);
+		img_free(mask);
+		return (EXIT_FAILURE);
+	}
+
+	img_and(image, mask);
+	rv = img_write_ppm(image, outfp);
+	img_free(image);
+	img_free(mask);
 	return (rv);
 }

@@ -409,6 +455,28 @@
 	return (score);
 }

+static void
+img_and(img_t *image, img_t *mask)
+{
+	unsigned int x, y, i;
+	img_pixel_t *imgpx, *maskpx;
+
+	assert(image->img_width == mask->img_width);
+	assert(image->img_height == mask->img_height);
+
+	for (y = 0; y < image->img_height; y++) {
+		for (x = 0; x < image->img_width; x++) {
+			i = img_coord(image, x, y);
+			maskpx = &mask->img_pixels[i];
+			imgpx = &image->img_pixels[i];
+
+			imgpx->r &= maskpx->r;
+			imgpx->g &= maskpx->g;
+			imgpx->b &= maskpx->b;
+		}
+	}
+}
+
 inline unsigned int
 img_coord(img_t *image, unsigned int x, unsigned int y)
 {


eloop.h: Remove inline function for id compare

--- include/eloop.h
+++ include/eloop.h
@@ -10,17 +10,6 @@
 #define PRIid PRIu64
 typedef uint64_t eloop_id_t;

-static inline int eloop_id_cmp(eloop_id_t id1, eloop_id_t id2)
-{
-    if (id1 > id2)
-        return 1;
-
-    if (id1 < id2)
-        return -1;
-
-    return 0;
-}
-
 typedef void (*task_cb_t)(void *ctx);

 #endif /* __ELOOP_H__ */


use C style comments

use C style comments

--- include/errno.h
+++ include/errno.h
@@ -47,8 +47,7 @@
 extern int errno;
 #endif

-#if 0 //def __USE_GNU
-/* uClibc note: not supported */
+#if 0 /*def __USE_GNU      uClibc note: not supported */

 /* The full and simple forms of the name with which the program was
    invoked.  These variables are set up automatically at startup based on


Change the function of find_tree_path

Change the function of find_tree_path

--- include/graph.h
+++ include/graph.h
@@ -30,7 +30,7 @@

 private:	//For internal functions
 	void add_edge(edge *, vertex *, vertex *, conductor_info, char, uint);
-	void find_tree_path(vertex *, vertex *, std::vector<edge *> &);
+	void find_tree_path(uint, vertex *, vertex *, std::vector<edge *> &);

 	arma::cx_rowvec flow_conservation_equation(vertex *);
 	std::pair<arma::cx_rowvec, comp> circular_equation(vertex *, edge *);


Automated master header file repair.

Automated master header file repair.

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

--- include/imesh.h
+++ include/imesh.h
@@ -28,6 +28,7 @@
 #include "imesh/fountain.h"
 #include "imesh/genmesh.h"
 #include "imesh/gmeshanim.h"
+#include "imesh/gmeshskel.h"
 #include "imesh/haze.h"
 #include "imesh/lghtng.h"
 #include "imesh/lighting.h"


Include <exception> to work with the latest boost version.

--- src/kml/dom.h
+++ src/kml/dom.h
@@ -29,6 +29,7 @@
 #ifndef KML_DOM_H__
 #define KML_DOM_H__

+#include <exception>
 #include "kml/dom/kml_cast.h"
 #include "kml/dom/kml_factory.h"
 #include "kml/dom/kml_funcs.h"


added 3d autoconfig to culler

added 3d autoconfig to culler

--- include/librg.h
+++ include/librg.h
@@ -2136,11 +2136,11 @@
             librg_data_init(&ctx->streams[i]);
         }

-        // streamer // TODO: make 3d
+        // streamer
         zplc_bounds_t world = {0};
         world.centre = zplm_vec3(0, 0, 0);
-        world.half_size = zplm_vec3(ctx->world_size.x, ctx->world_size.y, 0.0f);
-        zplc_init(&ctx->streamer, ctx->allocator, zplc_dim_2d_ev, world, 4);
+        world.half_size = zplm_vec3(ctx->world_size.x, ctx->world_size.y, ctx->world_size.z);
+        zplc_init(&ctx->streamer, ctx->allocator, ctx->world_size.z == 0.0f ? zplc_dim_2d_ev : zplc_dim_3d_ev, world, 4);}
         librg_table_init(&ctx->entity.ignored, ctx->allocator);

         // events


Add a function to get if memory is empty.

--- src/libidaten/cuda/cudamemory.h
+++ src/libidaten/cuda/cudamemory.h
@@ -38,6 +38,11 @@
 		}

 		void free();
+
+		bool empty() const
+		{
+			return (m_device == nullptr);
+		}

 		static uint32_t getHeapSize();


revert PRODUCT_xxx to SOLVALBLE_xxx add PRODUCT_REFERENCES

--- src/knownid.h
+++ src/knownid.h
@@ -153,11 +153,8 @@
 KNOWNID(PRODUCT_EXTRAURLS,		"product:extraurls"),
 KNOWNID(PRODUCT_OPTIONALURLS,		"product:optionalurls"),
 KNOWNID(PRODUCT_FLAGS,			"product:flags"),
-KNOWNID(PRODUCT_NAME,			"product:name"),
-KNOWNID(PRODUCT_VERSION,		"product:version"),
 KNOWNID(PRODUCT_FLAVOR,			"product:flavor"),
-KNOWNID(PRODUCT_DISTRIBUTION,		"product:distribution"),
-KNOWNID(PRODUCT_VENDOR,		        "product:vendor"),
+KNOWNID(PRODUCT_REFERENCES,		"product:references"),

 /* argh */
 KNOWNID(SUSETAGS_DATADIR,		"susetags:datadir"),


Deleted accidentally committed file

Deleted accidentally committed file

--- libs/core/mail/mime-err.c
+++ libs/core/mail/mime-err.c
@@ -1,16 +0,0 @@
-void func(unsigned len);
-void func(unsigned len) {
-
-	int state = 0;
-
-	for (unsigned i = 0; i < len && state != 3; i++) {
-
-		if (state == 0) {
-			state = 1;
-		} else if (state == 1 ) {
-			state = 3;
-		} else if (state != 0) {
-			state = 0;
-		}
-	}
-}


Fix definitions that conflict with uClibc.

Apparently these macros are pretty popular.

--- include/local.h
+++ include/local.h
@@ -197,6 +197,7 @@
 # ifdef HAVE_ELF

 /* We want the .gnu.warning.SYMBOL section to be unallocated.  */
+#ifndef __make_section_unallocated
 #  ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
 #   define __make_section_unallocated(section_string)	\
   asm (".section " section_string "\n\t.previous");
@@ -206,9 +207,11 @@
 #  else
 #   define __make_section_unallocated(section_string)
 #  endif
+#endif

 /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
    section attributes on what looks like a comment to the assembler.  */
+#ifndef link_warning
 #  ifdef HAVE_SECTION_QUOTES
 #   define link_warning(symbol, msg) \
   __make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
@@ -220,6 +223,7 @@
   static const char __evoke_link_warning_##symbol[]	\
     __attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\n\t#"))) = msg;
 #  endif
+#endif
 # else
 #  define link_warning(symbol, msg)		\
   asm (".stabs \"" msg "\",30,0,0,0\n\t"	\


card-incrypto34: Remove dead code

card-incrypto34: Remove dead code

git-svn-id: 444ed946b9c2220da791e84c3dd156a05f92db99@4235 c6295689-39f2-0310-b995-f0e70906c6a9

--- src/libopensc/card-incrypto34.c
+++ src/libopensc/card-incrypto34.c
@@ -621,44 +621,6 @@
 	SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, r);
 }

-#if 0
-static int
-incrypto34_lifecycle_set(sc_card_t *card, int *mode)
-{
-	sc_apdu_t	apdu;
-	int		r;
-
-	int current;
-	int target;
-
-	SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
-
-	target = *mode;
-
-	r = incrypto34_lifecycle_get(card, &current);
-
-	if (r != SC_SUCCESS)
-		return r;
-
-	if (current == target || current == SC_CARDCTRL_LIFECYCLE_OTHER)
-		return SC_SUCCESS;
-
-	sc_format_apdu(card, &apdu, SC_APDU_CASE_1, 0x10, 0, 0);
-	apdu.cla = 0x80;
-	apdu.le = 0;
-	apdu.resplen = 0;
-	apdu.resp = NULL;
-
-	r = sc_transmit_apdu(card, &apdu);
-	SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed");
-
-	r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-	SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "Card returned error");
-
-	SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, r);
-}
-#endif
-
 static int
 incrypto34_put_data_oci(sc_card_t *card,
 			struct sc_cardctl_incrypto34_obj_info *args)


gfx: Fix second special case of GP_Line().

--- libs/gfx/algo/Line.algo.h
+++ libs/gfx/algo/Line.algo.h
@@ -46,12 +46,11 @@
 			PUTPIXEL(context, x0, y0, pixval); \
 			return; \
 		} \
-		int y = y0; \
-		while (y != y1) { \
+		if (y0 > y1) \
+			GP_SWAP(y0, y1); \
+		int y; \
+		for (y = y0; y <= y1; y++) \
 			PUTPIXEL(context, x0, y, pixval); \
-			if (y0 > y1) y--; \
-			else y++; \
-		} \
 		return; \
 	} \
 \


- Moving.

- Moving.

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

--- include/mmdev.h
+++ include/mmdev.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2011-2014, Ailamazyan Program Systems Institute (Russian
+ * Academy of Science). See COPYING in top-level directory. */
+
+/* vim: set syntax=c et sw=4 ts=4: */
+
+#ifndef MMDEV_H
+#define MMDEV_H
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <unistd.h>
+#include "pautina-driver.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int mmdev_open (const char * pathname, int flags);
+extern int mmdev_close (int fd);
+extern int mmdev_ioctl (int fd, unsigned long request, pautina_driver_ioctl_arg_t arg);
+extern void * mmdev_mmap (void * addr, size_t length, int prot, int flags, int fd, off_t offset);
+extern int mmdev_munmap (void * addr, size_t length);
+
+extern void * mmdev_memcpy (void * dst, const void * src, size_t n);
+extern void mmdev_put64 (volatile void * ptr, uint64_t value);
+extern uint64_t mmdev_get64 (volatile void * ptr);
+extern void mmdev_fence();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MMDEV_H */


fixed pointer to params in Model

fixed pointer to params in Model

--- include/model.h
+++ include/model.h
@@ -40,30 +40,28 @@

 	///For the MultiPlane one
 	Model(std::string paramfile,long* seed){
-		InputParams pa = InputParams(paramfile);
+		params = new InputParams(paramfile);

 		cosmo = new COSMOLOGY();
-		lens = new L(pa,seed);
-		source = new S(pa);
-
-		params = &pa;
+		lens = new L(*params,seed);
+		source = new S(*params);

 		setInternal();
 	};
 	/// For the AnaLens one
 	Model(std::string paramfile){
-		InputParams pa = InputParams(paramfile);
+		params = new InputParams(paramfile);

 		cosmo = new COSMOLOGY();
-		lens = new L(pa);
-		source = new S(pa);
-
-		params = &pa;
+		lens = new L(*params);
+		source = new S(*params);

 		setInternal();
 	};
 	///Others
 	Model(long* seed){
+		params = NULL;
+
 		cosmo = new COSMOLOGY();
 		lens = new L();
 		source = new S();
@@ -71,6 +69,7 @@
 		setInternal();
 		};
 	Model(){
+		params = NULL;
 		cosmo = new COSMOLOGY();
 		lens = new L();
 		source = new S();
@@ -78,6 +77,8 @@
 		setInternal();
 	};
 	~Model(){
+		if(params)
+			delete params;
 		delete lens;
 		delete source;
 		delete cosmo;


Added check for accessing unexpected NULL in MySQL::Result::operator[]()

--- include/mysql.h
+++ include/mysql.h
@@ -188,8 +188,12 @@
 		return (row_[idx] == nullptr);
 	}

-	StringView operator[](unsigned idx) NO_DEBUG_MYSQL(noexcept) {
+	StringView operator[](unsigned idx) {
+		STACK_UNWINDING_MARK;
 		DEBUG_MYSQL(throw_assert(idx < fields_num());)
+		if (is_null(idx))
+			THROW("Encountered NULL at column ", idx, " that did not expect nullable data");
+
 		return {row_[idx], lengths_[idx]};
 	}

@@ -655,6 +659,8 @@
 	}

 	bool next() {
+		STACK_UNWINDING_MARK;
+
 		int rc = mysql_stmt_fetch(stmt_);
 		if (rc == 0) {
 			// Check for unexpected nulls


Adding temporay Windows config.

Adding temporay Windows config.

--- libsqaod/common/defines.h
+++ libsqaod/common/defines.h
@@ -47,7 +47,14 @@
 #include <assert.h> /* Here's the only place to include assert.h */

+#ifdef __linux__
 /* macros generated by autoconf */
 #include <common/sqaod_config.h>
+#endif
+
+#ifdef _WIN32
+#define SQAOD_CUDA_ENABLED
+/* #define SQAOD_WITH_BLAS */
+#endif

 #endif


OpenGL: More RAIIUtils

OpenGL: More RAIIUtils

--- modules/opengl/openglutils.h
+++ modules/opengl/openglutils.h
@@ -84,6 +84,54 @@
     int oldValue_;
 };

+
+struct GlBoolState {
+    GlBoolState() = delete;
+    GlBoolState(GlBoolState const&) = delete;
+    GlBoolState& operator=(GlBoolState const& that) = delete;
+
+    GlBoolState(GLenum target, bool state)
+        : target_(target), oldState_{}, state_(state) {
+
+        oldState_ = glIsEnabled(target_);
+        if (oldState_ != state_) {
+            if (state) glEnable(target_);
+            else glDisable(target_);
+        }
+    }
+
+    GlBoolState(GlBoolState&& rhs)
+        : target_(rhs.target_), oldState_(rhs.oldState_), state_(rhs.state_) {
+        rhs.state_ = rhs.oldState_;
+    }
+    GlBoolState& operator=(GlBoolState&& that) {
+        if (this != &that) {
+            target_ = 0;
+            std::swap(target_, that.target_);
+            state_ = that.oldState_;
+            std::swap(state_, that.state_);
+            oldState_ = that.oldState_;
+        }
+        return *this;
+    }
+
+    operator bool() { return state_; };
+
+    ~GlBoolState() {
+        if(oldState_ != state_) {
+            if (oldState_) glEnable(target_);
+            else glDisable(target_);
+        }
+    }
+
+private:
+    GLenum target_;
+    bool oldState_;
+    bool state_;
+};
+
+
+
 }  // namespace

 }  // namespace


If dynamic drivers are enabled, every driver needs to export it's symbols and the core plplot library imports them. If dynamic drivers are disabled, but a shared library is built, the drivers are inluded in the plplot library and must therefore exported within the library. These changes take this into consideration.

svn path=/trunk/; revision=9006

--- include/pldll.h
+++ include/pldll.h
@@ -40,6 +40,31 @@
 #else
   #define PLDLLIMPEXP PLDLLIMPORT
   #define PLDLLIMPEXP_DATA(type) PLDLLIMPORT type
+#endif
+
+/* for dynamic drivers set the macros correctly. If a shared library is built,
+   but dyanmic drivers disabled, the driver dll macros are the same as the
+   plplot dll macros */
+#ifdef ENABLE_DYNDRIVERS
+  #if defined(aqt_EXPORTS) || defined(cairo_EXPORTS) || defined(cgm_EXPORTS) || \
+       defined(dg300_EXPORTS) || defined(gd_EXPORTS) || defined(gcw_EXPORTS) || \
+       defined(hpgl_EXPORTS) || defined(impress_EXPORTS) || defined(linuxvga_EXPORTS) || \
+       defined(ljii_EXPORTS) || defined(ljiip_EXPORTS) || defined(mem_EXPORTS) || \
+       defined(ntk_EXPORTS) || defined(null_EXPORTS) || defined(pbm_EXPORTS) || \
+       defined(pdf_EXPORTS) || defined(plmeta_EXPORTS) || defined(ps_EXPORTS) || \
+       defined(pstex_EXPORTS) || defined(psttf_EXPORTS) || defined(svg_EXPORTS) || \
+       defined(tek_EXPORTS) || defined(tk_EXPORTS) || defined(tkwin_EXPORTS) || \
+       defined(wingcc_EXPORTS) || defined(wxwidgets_EXPORTS) || defined(xfig_EXPORTS) || \
+       defined(xwin_EXPORTS)
+    #define PLDLLIMPEXP_DRIVER PLDLLEXPORT
+    #define PLDLLIMPEXP_DRIVER_DATA(type) PLDLLEXPORT type
+  #else
+    #define PLDLLIMPEXP_DRIVER PLDLLIMPORT
+    #define PLDLLIMPEXP_DRIVER_DATA(type) PLDLLIMPORT type
+  #endif
+#else
+  #define PLDLLIMPEXP_DRIVER PLDLLIMPEXP
+  #define PLDLLIMPEXP_DRIVER_DATA(type) PLDLLIMPEXP_DATA(type)
 #endif

 #if defined(plplotcxxd_EXPORTS)
@@ -98,21 +123,4 @@
   #define PLDLLIMPEXP_GNOME2_DATA(type) PLDLLIMPORT type
 #endif

-#if defined(aqt_EXPORTS) || defined(cairo_EXPORTS) || defined(cgm_EXPORTS) || \
-     defined(dg300_EXPORTS) || defined(gd_EXPORTS) || defined(gcw_EXPORTS) || \
-     defined(hpgl_EXPORTS) || defined(impress_EXPORTS) || defined(linuxvga_EXPORTS) || \
-     defined(ljii_EXPORTS) || defined(ljiip_EXPORTS) || defined(mem_EXPORTS) || \
-     defined(ntk_EXPORTS) || defined(null_EXPORTS) || defined(pbm_EXPORTS) || \
-     defined(pdf_EXPORTS) || defined(plmeta_EXPORTS) || defined(ps_EXPORTS) || \
-     defined(pstex_EXPORTS) || defined(psttf_EXPORTS) || defined(svg_EXPORTS) || \
-     defined(tek_EXPORTS) || defined(tk_EXPORTS) || defined(tkwin_EXPORTS) || \
-     defined(wingcc_EXPORTS) || defined(wxwidgets_EXPORTS) || defined(xfig_EXPORTS) || \
-     defined(xwin_EXPORTS)
-  #define PLDLLIMPEXP_DRIVER PLDLLEXPORT
-  #define PLDLLIMPEXP_DRIVER_DATA(type) PLDLLEXPORT type
-#else
-  #define PLDLLIMPEXP_DRIVER PLDLLIMPORT
-  #define PLDLLIMPEXP_DRIVER_DATA(type) PLDLLIMPORT type
-#endif
-
 #endif /* __PL_DLL_H */


compress actions in all cases, not just sometimes

--- libswfdec/swfdec_player.c
+++ libswfdec/swfdec_player.c
@@ -355,37 +355,29 @@
   }
   SWFDEC_INFO ("compresed action queue to %u elements",
       swfdec_ring_buffer_get_n_elements (buffer));
-}
-
-/**
- * swfdec_player_add_event:
- * @player: a #SwfdecPlayer
- * @movie: the movie on which to trigger the event
- * @type: type of the event
- * @importance: importance of the event
- *
- * Adds an action to the @player. Actions are used by Flash player to solve
- * reentrancy issues. Instead of calling back into the Actionscript engine,
- * an action is queued for later execution. So if you're writing code that
- * is calling Actionscript code, you want to do this by using actions.
- **/
-void
-swfdec_player_add_action (SwfdecPlayer *player, SwfdecMovie *movie, SwfdecEventType type,
-    guint importance)
-{
-  SwfdecPlayerAction *action;
-
-  g_return_if_fail (SWFDEC_IS_PLAYER (player));
-  g_return_if_fail (SWFDEC_IS_MOVIE (movie));
-  g_return_if_fail (importance < SWFDEC_PLAYER_N_ACTION_QUEUES);
-
-  SWFDEC_LOG ("adding action %s %u", movie->name, type);
-  action = swfdec_ring_buffer_push (player->actions[importance]);
+  g_print ("compresed action queue to %u elements\n",
+      swfdec_ring_buffer_get_n_elements (buffer));
+  for (i = 0; i < swfdec_ring_buffer_get_n_elements (buffer); i++) {
+    action = swfdec_ring_buffer_peek_nth (buffer, i);
+    g_assert (action->movie != NULL);
+  }
+}
+
+static void
+swfdec_player_do_add_action (SwfdecPlayer *player, guint importance, SwfdecPlayerAction *act)
+{
+  SwfdecPlayerAction *action = swfdec_ring_buffer_push (player->actions[importance]);
   if (action == NULL) {
     /* try to get rid of freed actions */
     if (swfdec_ring_buffer_get_size (player->actions[importance]) >= 256) {
       swfdec_player_compress_actions (player->actions[importance]);
+      g_print ("%u/%u elements\n",
+	  swfdec_ring_buffer_get_n_elements (player->actions[importance]),
+	  swfdec_ring_buffer_get_size (player->actions[importance]));
       action = swfdec_ring_buffer_push (player->actions[importance]);
+      g_print ("%u/%u elements: action %p\n",
+	  swfdec_ring_buffer_get_n_elements (player->actions[importance]),
+	  swfdec_ring_buffer_get_size (player->actions[importance]), action);
       /* if it doesn't get smaller, bail */
       if (action == NULL) {
 	swfdec_as_context_abort (SWFDEC_AS_CONTEXT (player),
@@ -399,16 +391,40 @@
       g_assert (action);
     }
   }
-  action->movie = movie;
-  action->script = NULL;
-  action->event = type;
+  *action = *act;
+}
+
+/**
+ * swfdec_player_add_event:
+ * @player: a #SwfdecPlayer
+ * @movie: the movie on which to trigger the event
+ * @type: type of the event
+ * @importance: importance of the event
+ *
+ * Adds an action to the @player. Actions are used by Flash player to solve
+ * reentrancy issues. Instead of calling back into the Actionscript engine,
+ * an action is queued for later execution. So if you're writing code that
+ * is calling Actionscript code, you want to do this by using actions.
+ **/
+void
+swfdec_player_add_action (SwfdecPlayer *player, SwfdecMovie *movie, SwfdecEventType type,
+    guint importance)
+{
+  SwfdecPlayerAction action = { movie, NULL, type };
+
+  g_return_if_fail (SWFDEC_IS_PLAYER (player));
+  g_return_if_fail (SWFDEC_IS_MOVIE (movie));
+  g_return_if_fail (importance < SWFDEC_PLAYER_N_ACTION_QUEUES);
+
+  SWFDEC_LOG ("adding action %s %u", movie->name, type);
+  swfdec_player_do_add_action (player, importance, &action);
 }

 void
 swfdec_player_add_action_script	(SwfdecPlayer *player, SwfdecMovie *movie,
     SwfdecScript *script, guint importance)
 {
-  SwfdecPlayerAction *action;
+  SwfdecPlayerAction action = { movie, script, 0 };

   g_return_if_fail (SWFDEC_IS_PLAYER (player));
   g_return_if_fail (SWFDEC_IS_MOVIE (movie));
@@ -416,22 +432,7 @@
   g_return_if_fail (importance < SWFDEC_PLAYER_N_ACTION_QUEUES);

   SWFDEC_LOG ("adding action script %s %s", movie->name, script->name);
-  action = swfdec_ring_buffer_push (player->actions[importance]);
-  if (action == NULL) {
-    /* FIXME: limit number of actions to not get inf loops due to scripts? */
-    if (swfdec_ring_buffer_get_size (player->actions[importance]) >= 256) {
-      /* FIXME: try to remove empty entries first? */
-      swfdec_as_context_abort (SWFDEC_AS_CONTEXT (player),
-	  "256 levels of recursion were exceeded in one action list.");
-      return;
-    }
-    swfdec_ring_buffer_set_size (player->actions[importance],
-	swfdec_ring_buffer_get_size (player->actions[importance]) + 16);
-    action = swfdec_ring_buffer_push (player->actions[importance]);
-    g_assert (action);
-  }
-  action->movie = movie;
-  action->script = script;
+  swfdec_player_do_add_action (player, importance, &action);
 }

 /**


made the Point::size_sq() member public as suggested by Mike Anderson.  There was no real reason to have it private.

git-svn-id: ffc1bc5b3feaf8644044862cc38c386ade156493@256 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- include/point.h
+++ include/point.h
@@ -1,4 +1,4 @@
-// $Id: point.h,v 1.12 2003-03-28 20:38:05 benkirk Exp $
+// $Id: point.h,v 1.13 2003-05-02 20:32:34 benkirk Exp $

 // The Next Great Finite Element Library.
 // Copyright (C) 2002  Benjamin S. Kirk, John W. Peterson
@@ -166,6 +166,12 @@
   Real size() const;

   /**
+   * Reutrns the magnitude of the point squared, i.e. the square-root
+   * of the sum of the elements squared.
+   */
+  Real size_sq() const;
+
+  /**
    * Zero the point in any dimension.
    */
   void zero();
@@ -202,12 +208,6 @@
  protected:

   /**
-   * Reutrns the magnitude of the point squared, i.e. the square-root
-   * of the sum of the elements squared.
-   */
-  Real size_sq() const;
-
-  /**
    * The coordinates of the \p Point
    */
   Real _coords[DIM];


fix a refleak in pngsave

fix a refleak in pngsave

introduced in https://github.com/libvips/libvips/commit/d8ed630d77c21a994e15939ccd148fcff9e423f2

--- libvips/foreign/pngsave.c
+++ libvips/foreign/pngsave.c
@@ -146,8 +146,12 @@
 	if( vips__png_write_target( in, png->target,
 		png->compression, png->interlace, png->profile, png->filter,
 		save->strip, png->palette, png->Q, png->dither,
-		png->bitdepth ) )
+		png->bitdepth ) ) {
+		g_object_unref( in );
 		return( -1 );
+	}
+
+	g_object_unref( in );

 	return( 0 );
 }


pkey: use DSA and RSA PrivateKey functions in to_pem

Detect what type of key we are dealing with and use the right to_pem
function. This way we match the enconding that the openssl dsa|rsa apps
use for certificates.

--- src/lcrypto.c
+++ src/lcrypto.c
@@ -986,12 +986,17 @@
 {
   EVP_PKEY **pkey = (EVP_PKEY **)luaL_checkudata(L, 1, LUACRYPTO_PKEYNAME);
   int private = lua_isboolean(L, 2) && lua_toboolean(L, 2);
+  struct evp_pkey_st *pkey_st = *pkey;

   long len;
   BUF_MEM *buf;
   BIO *mem = BIO_new(BIO_s_mem());

-  if(private)
+  if (private && pkey_st->type == EVP_PKEY_DSA)
+    PEM_write_bio_DSAPrivateKey(mem, pkey_st->pkey.dsa, NULL, NULL, 0, NULL, NULL);
+  else if (private && pkey_st->type == EVP_PKEY_RSA)
+    PEM_write_bio_RSAPrivateKey(mem, pkey_st->pkey.rsa, NULL, NULL, 0, NULL, NULL);
+  else if (private)
     PEM_write_bio_PrivateKey(mem, *pkey, NULL, NULL, 0, NULL, NULL);
   else
     PEM_write_bio_PUBKEY(mem, *pkey);


making all tmesh time relative and 32bit microseconds

--- include/tmesh.h
+++ include/tmesh.h
@@ -78,19 +78,21 @@
 struct knock_struct
 {
   mote_t mote;
-  uint64_t start, stop, actual; // microsecond exact start/stop time
+  uint32_t start, stop, actual; // microsecond exact start/stop time
   uint8_t frame[64];
   uint8_t chan; // current channel (< med->chans)
   uint8_t tx:1; // tells radio to tx or rx
 };

-// fills in next knock based on from and only for this device
-tmesh_t tmesh_knock(tmesh_t tm, knock_t k, uint64_t from, radio_t device);
-tmesh_t tmesh_knocked(tmesh_t tm, knock_t k); // process done knock
+// advance all windows forward this many microseconds, all knocks are relative to this call
+tmesh_t tmesh_bttf(tmesh_t tm, uint32_t us);

+// fills in next knock for this device only
+tmesh_t tmesh_knock(tmesh_t tm, knock_t k, radio_t device);

-// 2^18
-#define EPOCH_WINDOW (uint64_t)262144
+// process done knock
+tmesh_t tmesh_knocked(tmesh_t tm, knock_t k);
+

 // mote state tracking
 struct mote_struct
@@ -102,8 +104,7 @@
   uint8_t nonce[8];
   uint8_t nwait[8]; // future nonce
   uint8_t chan[2];
-  uint64_t at; // microsecond of last knock
-  uint64_t tmp; // TODO remove, for debugging only
+  uint32_t next; // microseconds until next knock
   util_chunks_t chunks; // actual chunk encoding for r/w frame buffers
   uint16_t sent, received;
   uint8_t z;
@@ -121,13 +122,13 @@
 mote_t mote_reset(mote_t m);

 // next knock init
-mote_t mote_knock(mote_t m, knock_t k, uint64_t from);
+mote_t mote_knock(mote_t m, knock_t k, uint32_t us);

 // initiates handshake over this synchronized mote
 mote_t mote_synced(mote_t m);

-// find the first nonce that occurs after this future time of this type, return that time
-uint64_t mote_seek(mote_t m, uint32_t after, uint8_t tx, uint8_t *nonce);
+// find the first nonce that occurs after this future time of this type
+mote_t mote_seek(mote_t m, uint32_t after, uint8_t tx, uint8_t *nonce);

 // for tmesh sorting
 knock_t knock_sooner(knock_t a, knock_t b);


set interlace flag for interlaced pngs

set interlace flag for interlaced pngs

if libpng is recent enough

--- libvips/foreign/vipspng.c
+++ libvips/foreign/vipspng.c
@@ -532,16 +532,20 @@

 	if( setjmp( png_jmpbuf( read->pPng ) ) )
 		return( -1 );
-
+
+	/* Some libpng warn you to call png_set_interlace_handling(); here, but
+	 * that can actually break interlace on older libpngs.
+	 *
+	 * Only set this for libpng 1.6+.
+	 */
+#if PNG_LIBPNG_VER > 10600
+	(void) png_set_interlace_handling( read->pPng );
+#endif
+
 	if( !(read->row_pointer = VIPS_ARRAY( NULL, out->Ysize, png_bytep )) )
 		return( -1 );
 	for( y = 0; y < out->Ysize; y++ )
 		read->row_pointer[y] = VIPS_IMAGE_ADDR( out, 0, y );
-
-	/* Some libpng warn you to call png_set_interlace_handling(); here, but
-	 * that can actually break interlace. We have to live with the warning,
-	 * unfortunately.
-	 */

 	png_read_image( read->pPng, read->row_pointer );


Added BumpHeap alias.

Added BumpHeap alias.

--- heaps/special/bumpalloc.h
+++ heaps/special/bumpalloc.h
@@ -105,6 +105,10 @@

   };

+  // We are going to rename this layer to BumpHeap and deprecate BumpAlloc eventually.
+  template <size_t Size, class X>
+  using BumpHeap = BumpAlloc<Size, X>;
+
 }

 #if defined(__clang__)


different macroname for types.h to not get into trouble

--- include/types.h
+++ include/types.h
@@ -19,8 +19,8 @@
 // changed by US

-#ifndef __TYPES_H__
-#define __TYPES_H__
+#ifndef __OLX_TYPES_H__
+#define __OLX_TYPES_H__

 #include <SDL.h>
 #include <cassert>


Fix assert_nargs macro.

Fix assert_nargs macro.

Signed-off-by: Casey Dwyer <b081c9b2b7eeca6405dae9ea99f00a8716526c5b@gmail.com>

--- src/li_proc.c
+++ src/li_proc.c
@@ -9,8 +9,9 @@
 #define has_1args(args)             ((args) && has_0args(li_cdr(args)))
 #define has_2args(args)             ((args) && has_1args(li_cdr(args)))
 #define has_3args(args)             ((args) && has_2args(li_cdr(args)))
-#define assert_nargs(name, n, as) \
-    if (!has_##n##args(as)) li_error(name, "wrong number of args", args)
+#define assert_nargs(name, n, args_) \
+    if (!has_##n##args(args_))       \
+        li_error(name, "wrong number of args", args_)
 #define assert_type(name, type, arg) \
     if (!li_is_##type(arg)) li_error(name, "not a " #type, arg)
 #define assert_integer(name, arg) \


includes/utils.h: add r_trace() function for even more details

This one might be used for printing output that is even more
fine-grained than what g_debug should show.

Can be used to dump algorithm internals, etc.

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

--- include/utils.h
+++ include/utils.h
@@ -9,6 +9,11 @@
 	g_log(R_LOG_DOMAIN_SUBPROCESS, G_LOG_LEVEL_DEBUG, "launching subprocess: %s", call);
 	g_free(call);
 }
+
+#define R_LOG_LEVEL_TRACE 1 << G_LOG_LEVEL_USER_SHIFT
+#define r_trace(...)   g_log(G_LOG_DOMAIN,         \
+		R_LOG_LEVEL_TRACE,    \
+		__VA_ARGS__)

 /**
  * Read file content into a GBytes.


Fix compilation in tracker.c

Fix compilation in tracker.c

--- src/libtracker-client/tracker.c
+++ src/libtracker-client/tracker.c
@@ -388,7 +388,7 @@

 	private->timeout = -1;
 	private->slow_pending_calls = g_hash_table_new_full (NULL,
-	                                                     NULL
+	                                                     NULL,
 	                                                     NULL,
 	                                                     (GDestroyNotify) slow_pending_call_free);


Modify TypeListMacros some more

Modify TypeListMacros some more

--- test/util/TypeListMacros.h
+++ test/util/TypeListMacros.h
@@ -22,11 +22,14 @@

 #define RC_NUMERIC_TYPES RC_REAL_TYPES, RC_INTEGRAL_TYPES

-#define RC_ORDERED_CONTAINERS(T)                \
+#define RC_SEQUENCE_CONTAINERS(T)               \
     std::vector<T>,                             \
     std::deque<T>,                              \
     std::forward_list<T>,                       \
-    std::list<T>,                               \
+    std::list<T>                                \
+
+#define RC_ORDERED_CONTAINERS(T)                \
+    RC_SEQUENCE_CONTAINERS(T),                  \
     std::set<T>,                                \
     std::map<T, T>,                             \
     std::multiset<T>,                           \


corrected indentation

corrected indentation

git-svn-id: 6826d79302c0325d1d563fbabfb3719d35deabed@29140 e8e8ed6c-164c-0410-afcf-9e9a7c7d8c10

--- src/include/posix/client/BlockingSQLiteKeyValueStore.h
+++ src/include/posix/client/BlockingSQLiteKeyValueStore.h
@@ -118,7 +118,7 @@
      * @param path      - The name of the full path to the database to use
      *
      */
-    BlockingSQLiteKeyValueStore(const StringBuffer & table, const StringBuffer & colKey,   const StringBuffer & colValue,
+    BlockingSQLiteKeyValueStore(const StringBuffer & table, const StringBuffer & colKey, const StringBuffer & colValue,
                         const StringBuffer & path)
                         : SQLiteKeyValueStore(table,colKey,colValue,path)
     {
@@ -146,7 +146,6 @@
         sem_post(&sema);
         return e;
     }
-

     /**
      * Ensure that all properties are stored persistently.


Use an allocating vprintf

Use an allocating vprintf

--- src/lib/lob.c
+++ src/lib/lob.c
@@ -233,8 +233,8 @@
   va_start(ap, format);
   va_copy(cp, ap);

-  len = (size_t) vsnprintf(NULL, 0, format, cp);
-  if((val = malloc(len))) vsprintf(val, format, ap);
+  len = vasprintf(&val, format, ap);
+
   va_end(ap);
   va_end(cp);
   if(!val) return NULL;


remove unnecessary checks and assertions

--- lib/http2/connection.c
+++ lib/http2/connection.c
@@ -411,7 +411,6 @@
 {
     int ret, header_exists_map;

-    assert(conn->state != H2O_HTTP2_CONN_STATE_IS_CLOSING);
     assert(stream->state == H2O_HTTP2_STREAM_STATE_RECV_HEADERS);

     header_exists_map = 0;
@@ -477,9 +476,6 @@
     ssize_t ret;
     h2o_http2_stream_t *stream;
     int hret;
-
-    if (conn->state == H2O_HTTP2_CONN_STATE_IS_CLOSING)
-        return 0;

     if ((ret = h2o_http2_decode_frame(&frame, src, len, &H2O_HTTP2_SETTINGS_HOST, err_desc)) < 0)
         return ret;
@@ -635,9 +631,6 @@
     h2o_http2_stream_t *stream;
     int ret;

-    if (conn->state == H2O_HTTP2_CONN_STATE_IS_CLOSING)
-        return 0;
-
     if ((ret = h2o_http2_decode_data_payload(&payload, frame, err_desc)) != 0)
         return ret;

@@ -668,9 +661,6 @@
     h2o_http2_headers_payload_t payload;
     h2o_http2_stream_t *stream;
     int ret;
-
-    if (conn->state == H2O_HTTP2_CONN_STATE_IS_CLOSING)
-        return 0;

     /* decode */
     if ((ret = h2o_http2_decode_headers_payload(&payload, frame, err_desc)) != 0)
@@ -1359,9 +1349,6 @@
     h2o_http2_conn_t *conn = (void *)src_req->conn;
     h2o_http2_stream_t *src_stream = H2O_STRUCT_FROM_MEMBER(h2o_http2_stream_t, req, src_req);

-    if (conn->state == H2O_HTTP2_CONN_STATE_IS_CLOSING)
-        return;
-
     /* RFC 7540 8.2.1: PUSH_PROMISE frames can be sent by the server in response to any client-initiated stream */
     if (h2o_http2_stream_is_push(src_stream->stream_id))
         return;


fix crash in java bindings when sentence is too long
(patch from Evgenii Filippov <efilippov@gmail.com>)

git-svn-id: fc35eccb03ccef1c432fd0fcf5295fcceaca86a6@25207 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6

--- link-grammar/jni-client.c
+++ link-grammar/jni-client.c
@@ -227,12 +227,12 @@
 	maxlen = parse_options_get_max_sentence_length(ptd->opts);
 	if (maxlen < sentence_length(ptd->sent))
 	{
-		sentence_delete(ptd->sent);
-		ptd->sent = NULL;
 		if (jverbosity > 0) {
 			prt_error("Error: Sentence length (%d words) exceeds maximum allowable (%d words)\n",
 				sentence_length(ptd->sent), maxlen);
 		}
+		sentence_delete(ptd->sent);
+		ptd->sent = NULL;
 		return;
 	}


net_getunixcred(): Fix to previous NetBSD<5 support: return pid as -1.

--- src/lib/net.c
+++ src/lib/net.c
@@ -837,6 +837,7 @@
 	}
 	cred_r->uid = sc->sc_euid;
 	cred_r->gid = sc->sc_egid;
+	cred_r->pid = (pid_t)-1;
 	return 0;
 #else
 	errno = EINVAL;


respect casper even if cache-digests is used

--- lib/http2/connection.c
+++ lib/http2/connection.c
@@ -1217,8 +1217,10 @@
                                      src_stream->req.input.authority, h2o_iovec_init(abspath, abspath_len));
         if (h2o_cache_digests_lookup_by_url(src_stream->cache_digests, url.base, url.len) == H2O_CACHE_DIGESTS_STATE_FRESH)
             return;
-    } else if (src_stream->req.hostconf->http2.casper.capacity_bits != 0) {
-        /* delayed initialization of casper (cookie-based), that MAY be used as a fallback to cache-digests */
+    }
+
+    /* delayed initialization of casper (cookie-based), that MAY be used together to cache-digests */
+    if (src_stream->req.hostconf->http2.casper.capacity_bits != 0) {
         if (!src_stream->pull.casper_is_ready) {
             src_stream->pull.casper_is_ready = 1;
             if (conn->casper == NULL)


free memory on exit

free memory on exit

git-svn-id: fc35eccb03ccef1c432fd0fcf5295fcceaca86a6@32426 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6

--- link-parser/link-parser.c
+++ link-parser/link-parser.c
@@ -102,6 +102,12 @@
 	static char * pline = NULL;
 	const char * prompt = "linkparser> ";

+	if (NULL == in)
+	{
+		if (pline) free(pline);
+		return NULL;
+	}
+
 	if (in != stdin)
 	{
 		static char input_string[MAX_INPUT];
@@ -134,6 +140,8 @@

 #else
 	static char input_string[MAX_INPUT];
+
+	if (NULL == in) return NULL;

 	if ((!parse_options_get_batch_mode(opts)) &&
 	    (verbosity > 0) &&
@@ -883,6 +891,7 @@
 	parse_options_delete(panic_parse_opts);
 	parse_options_delete(opts);
 	dictionary_delete(dict);
+	fget_input_string(NULL, NULL, NULL);

 	printf ("Bye.\n");
 	return 0;


FFI: Add ffi.typeinfo().

FFI: Add ffi.typeinfo().

Thanks to Peter Colberg.

--- src/lib_ffi.c
+++ src/lib_ffi.c
@@ -557,6 +557,31 @@
   setcdataV(L, L->top-1, cd);
   lj_gc_check(L);
   return 1;
+}
+
+/* Internal and unsupported API. */
+LJLIB_CF(ffi_typeinfo)
+{
+  CTState *cts = ctype_cts(L);
+  CTypeID id = (CTypeID)ffi_checkint(L, 1);
+  if (id > 0 && id < cts->top) {
+    CType *ct = ctype_get(cts, id);
+    GCtab *t;
+    lua_createtable(L, 0, 4);  /* Increment hash size if fields are added. */
+    t = tabV(L->top-1);
+    setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "info")), (int32_t)ct->info);
+    if (ct->size != CTSIZE_INVALID)
+      setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "size")), (int32_t)ct->size);
+    if (ct->sib)
+      setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "sib")), (int32_t)ct->sib);
+    if (gcref(ct->name)) {
+      GCstr *s = gco2str(gcref(ct->name));
+      setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "name")), s);
+    }
+    lj_gc_check(L);
+    return 1;
+  }
+  return 0;
 }

 LJLIB_CF(ffi_istype)	LJLIB_REC(.)


Small bug in .h file fixed

Small bug in .h file fixed

--- linked_list/linked_list.h
+++ linked_list/linked_list.h
@@ -66,7 +66,7 @@
     const int size() const;
     void empty();
     bool isEmpty();
-    friend std::ostream& operator<< (std::ostream& os, const circular_linked_list<T>& list);
+    friend std::ostream& operator<< (std::ostream& os, const linked_list<T>& list);
 };

 #endif


Fixed the Travis build 'redefinition of typedef' warnings (= errors).

--- include/zsock.h
+++ include/zsock.h
@@ -103,9 +103,8 @@
 //  -------------------------------------------------------------------------
 //  Extensions

-//  Opaque class structures
-typedef struct _zframe_t zframe_t;
-typedef struct _zmsg_t zmsg_t;
+#include "zframe.h"
+#include "zmsg.h"

 //  Return a pointer to the 0MQ socket.
 CZMQ_EXPORT void *


fix cielab to ciexyz conversion

fix cielab to ciexyz conversion

Signed-off-by: Mattias Andrée <3d72f033b30d63e7ff5f0b71398e9c45b66386a1@kth.se>

--- src/libclut.h
+++ src/libclut.h
@@ -2079,8 +2079,8 @@
       *X__ = a__ / 500 + *Y__;					\
       *Z__ = *Y__ - b__ / 200;					\
       *X__ = LIBCLUT_MODEL_CIELAB_TO_CIEXYZ__(*X__) * 0.95047;	\
-      *Y__ = LIBCLUT_MODEL_CIELAB_TO_CIEXYZ__(*Y__);		\
-      *Z__ = LIBCLUT_MODEL_CIELAB_TO_CIEXYZ__(*Z__) * 1.08883;	\
+      *Y__ = LIBCLUT_MODEL_CIELAB_TO_CIEXYZ__(*Y__) * 1.08883;	\
+      *Z__ = LIBCLUT_MODEL_CIELAB_TO_CIEXYZ__(*Z__);		\
     }								\
   while (0)
 #define LIBCLUT_MODEL_CIELAB_TO_CIEXYZ__(C)  \


[install] Search versioned install directories for runtime library, include,
and dynext.

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@36720 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- src/library.c
+++ src/library.c
@@ -159,7 +159,7 @@
 {
     ASSERT_ARGS(parrot_init_library_paths)
     PMC *paths;
-    STRING *entry;
+    STRING *entry, *version, *versionlib;

     PMC * const iglobals = interp->iglobals;
     PMC * const config_hash =
@@ -192,6 +192,12 @@
     entry = CONST_STRING(interp, "lib/parrot/");
     VTABLE_push_string(interp, paths, entry);

+    version = CONST_STRING(interp, PARROT_VERSION);
+    versionlib = Parrot_str_append(interp, entry, version);
+    entry = Parrot_str_append(interp, versionlib, CONST_STRING(interp, "/include/"));
+    VTABLE_push_string(interp, paths, entry);
+
+
     /* define library paths */
     paths = pmc_new(interp, enum_class_ResizableStringArray);
     VTABLE_set_pmc_keyed_int(interp, lib_paths,
@@ -211,6 +217,8 @@
     VTABLE_push_string(interp, paths, entry);
     entry = CONST_STRING(interp, "lib/parrot/");
     VTABLE_push_string(interp, paths, entry);
+    entry = Parrot_str_append(interp, versionlib, CONST_STRING(interp, "/library/"));
+    VTABLE_push_string(interp, paths, entry);

     /* define dynext paths */
     paths = pmc_new(interp, enum_class_ResizableStringArray);
@@ -221,6 +229,8 @@
     entry = CONST_STRING(interp, "");
     VTABLE_push_string(interp, paths, entry);
     entry = CONST_STRING(interp, "lib/parrot/dynext/");
+    VTABLE_push_string(interp, paths, entry);
+    entry = Parrot_str_append(interp, versionlib, CONST_STRING(interp, "/dynext/"));
     VTABLE_push_string(interp, paths, entry);

     /* shared exts */


library: Fix NULL pointer dereference

library: Fix NULL pointer dereference

This may be seen when calling stoken_import_rcfile() through the library
interface.  It was introduced with the new v3 token support code.

Signed-off-by: Kevin Cernekee <3105dbb3dd63fbb4f6371cfb04adc6726f76c56b@gmail.com>

--- src/library.c
+++ src/library.c
@@ -271,8 +271,8 @@

 static void zap_current_token(struct stoken_ctx *ctx)
 {
-	free(ctx->t->v3);
 	if (ctx->t) {
+		free(ctx->t->v3);
 		sdtid_free(ctx->t->sdtid);
 		free(ctx->t);
 	}


Add debug instructions for bundle resolution...

--- src/s6-rc/s6-rc-compile.c
+++ src/s6-rc/s6-rc-compile.c
@@ -254,7 +254,7 @@
   if (fd < 0) return 0 ;
   buffer_init(&b, &fd_readsv, fd, buf, 2048) ;
   *listindex = genalloc_len(unsigned int, &be->indices) ;
-  DBG("add_namelist %s %s: *listindex is %u", name, list, *listindex) ;
+  // DBG("add_namelist %s %s: *listindex is %u", name, list, *listindex) ;
   while (cont)
   {
     register int r = skagetln(&b, &satmp, '\n') ;
@@ -287,7 +287,7 @@
   }
   close(fd) ;
   *n = genalloc_len(unsigned int, &be->indices) - *listindex ;
-  DBG("add_namelist %s %s: *n is %u", name, list, *n) ;
+  // DBG("add_namelist %s %s: *n is %u", name, list, *n) ;
   return 1 ;
 }

@@ -534,16 +534,20 @@
       register nameinfo_t const *p ;
       avltree_search(&names_map, data.s + listindex[j], &id) ;
       p = genalloc_s(nameinfo_t, &nameinfo) + id ;
+      DBG("resolve_bundle_rec: %s depends on %s", data.s + me->name, data.s + p->pos) ;
       switch (p->type)
       {
         case SVTYPE_ONESHOT :
           bitarray_set(recinfo->barray + i * recinfo->nbits, recinfo->nlong + p->i) ;
+          DBG("resolve_bundle_rec: %s is a oneshot, setting bit %u in barray[%u]", data.s + p->pos, recinfo->nlong + p->i, i) ;
           break ;
         case SVTYPE_LONGRUN :
           bitarray_set(recinfo->barray + i * recinfo->nbits, p->i) ;
+          DBG("resolve_bundle_rec: %s is a longrun, setting bit %u in barray[%u]", data.s + p->pos, p->i, i) ;
           break ;
         case SVTYPE_BUNDLE :
           resolve_bundle_rec(recinfo, p->i) ;
+          DBG("resolve_bundle_rec: %s is a bundle, adding barray[%u] to barray[%u]", data.s + p->pos, p->i, i) ;
           bitarray_or(recinfo->barray + i * recinfo->nbits, recinfo->barray + i * recinfo->nbits, recinfo->barray + p->i * recinfo->nbits, recinfo->n) ;
           break ;
         default :
@@ -587,7 +591,11 @@
     uint32 *mydeps = bdeps + bundles[i].listindex ;
     unsigned int j = 0, k = 0 ;
     for (; k < bundles[i].n ; j++)
-      if (bitarray_peek(mybits, j)) mydeps[k++] = j ;
+      if (bitarray_peek(mybits, j))
+      {
+        mydeps[k++] = j ;
+        DBG("flatlist_bundles: bundle %u contains service %u", i, j) ;
+      }
   }
 }


force deep binding so that OpenCL implementation use their own functions

git-svn-id: 33409ba78411f2a1359a9b73a7b59b6f729a477f@19 54081c91-f12c-4b0d-b4b4-172e8089a626

--- ocl_icd.c
+++ ocl_icd.c
@@ -95,7 +95,7 @@
     if( lib_path[lib_path_length-1] == '\n' )
       lib_path[lib_path_length-1] = '\0';

-    _vendor_dl_handles[num_vendors] = dlopen(lib_path, RTLD_LAZY|RTLD_LOCAL);
+    _vendor_dl_handles[num_vendors] = dlopen(lib_path, RTLD_LAZY|RTLD_LOCAL|RTLD_DEEPBIND);
     free(lib_path);
     if(_vendor_dl_handles[num_vendors] != NULL)
       num_vendors++;


Close access to vdev when setting state to anything but open state.
This fixes replacing drive in place, eg. zpool replace tank da1 da1.
Before the fix, it complained that device is already open.

Obtained from:	OpenSolaris
Approved by:	re (gnn)

--- sys/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+++ sys/contrib/opensolaris/uts/common/fs/zfs/vdev.c
@@ -1845,6 +1845,17 @@

 	vd->vdev_state = state;
 	vd->vdev_stat.vs_aux = aux;
+
+	/*
+	 * If we are setting the vdev state to anything but an open state, then
+	 * always close the underlying device.  Otherwise, we keep accessible
+	 * but invalid devices open forever.  We don't call vdev_close() itself,
+	 * because that implies some extra checks (offline, etc) that we don't
+	 * want here.  This is limited to leaf devices, because otherwise
+	 * closing the device will affect other children.
+	 */
+	if (vdev_is_dead(vd) && vd->vdev_ops->vdev_op_leaf)
+		vd->vdev_ops->vdev_op_close(vd);

 	if (state == VDEV_STATE_CANT_OPEN) {
 		/*


Doubled coap stack size

Doubled coap stack size

Signed-off-by: Fabian Reimeier <9c3ef9a426ef42ba480b158f98ed1a50f743ca56@fu-berlin.de>

--- sensor/main.c
+++ sensor/main.c
@@ -16,7 +16,7 @@

 #define MULTICAST_ADDR "ff02::13"

-static char thread_stack[THREAD_STACKSIZE_DEFAULT];
+static char thread_stack[2 * THREAD_STACKSIZE_DEFAULT];

 char* link_addr = "2001:db8::1";
 kernel_pid_t iface_pid = 6;
@@ -72,7 +72,7 @@
     if (temp_sensor_init() == 0) {
         puts("Temperature sensor initialized");

-        thread_create(thread_stack, THREAD_STACKSIZE_DEFAULT, THREAD_PRIORITY_MAIN - 1, 0, temp_thread, NULL, "Sensor Thread");
+        thread_create(thread_stack, 2 * THREAD_STACKSIZE_DEFAULT, THREAD_PRIORITY_MAIN - 1, 0, temp_thread, NULL, "Sensor Thread");
     }

     // Taken from the hello world example!


Small cleanup

Small cleanup

--- mud/home/System/lib/system.c
+++ mud/home/System/lib/system.c
@@ -18,7 +18,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include <kotaka/paths/system.h>
-#include <type.h>

 inherit SECOND_AUTO;
 inherit "system/escape";


- moved myproxy_authorize_init() to myproxy.c and renamed it   myproxy_handle_authorization(). we want to do authorization in all   myproxy clients now. - moved sasl code to myproxy_sasl_client.c.

--- myproxy/myproxy_delegation.c
+++ myproxy/myproxy_delegation.c
@@ -1,15 +1,4 @@
 #include "myproxy_common.h"	/* all needed headers included here */
-
-#if defined(HAVE_LIBSASL2)
-static int
-auth_sasl_negotiate_client(myproxy_socket_attrs_t *attrs,
-			   myproxy_request_t *client_request);
-#endif
-
-static int myproxy_authorize_init(myproxy_socket_attrs_t *attrs,
-                                  myproxy_request_t *client_request,
-				  char *certfile,
-				  int  use_kerberos);

 int myproxy_set_delegation_defaults(
     myproxy_socket_attrs_t *socket_attrs,
@@ -81,13 +70,21 @@
     }

     /* Continue unless the response is not OK */
-    if (myproxy_authorize_init(socket_attrs, client_request,
-	                       certfile, use_kerberos) < 0) {
-	  fprintf(stderr, "%s\n",
-	          verror_get_string());
-	  return(1);
-    }
-
+    do {
+	if (myproxy_recv_response(socket_attrs, server_response) != 0) {
+	    fprintf(stderr, "%s\n", verror_get_string());
+	    return(1);
+	}
+	if (server_response->response_type == MYPROXY_AUTHORIZATION_RESPONSE) {
+	    if (myproxy_handle_authorization(socket_attrs, server_response,
+					     client_request, certfile,
+					     use_kerberos) != 0) {
+		fprintf(stderr, "%s\n", verror_get_string());
+		return(1);
+	    }
+	}
+    } while (server_response->response_type == MYPROXY_AUTHORIZATION_RESPONSE);
+
     /* Accept delegated credentials from server */
     if (myproxy_accept_delegation(socket_attrs, delegfile, sizeof(delegfile),
 				  NULL) < 0) {
@@ -114,388 +111,3 @@

     return(0);
 }
-
-static int
-myproxy_authorize_init(myproxy_socket_attrs_t *attrs,
-                       myproxy_request_t *client_request,
-		       char *certfile,
-		       int  use_kerberos)
-{
-   myproxy_response_t *server_response = NULL;
-   myproxy_proto_response_type_t response_type;
-   authorization_data_t *d;
-   /* just pointer into server_response->authorization_data, no memory is
-      allocated for this pointer */
-   int return_status = -1;
-   char *buffer = NULL;
-   int bufferlen;
-
-   do {
-      server_response = malloc(sizeof(*server_response));
-      memset(server_response, 0, sizeof(*server_response));
-      if (myproxy_recv_response(attrs, server_response) < 0) {
-	 goto end;
-      }
-
-      response_type = server_response->response_type;
-      if (response_type == MYPROXY_AUTHORIZATION_RESPONSE) {
-	 if (certfile != NULL)
-	    d = authorization_create_response(
-		               server_response->authorization_data,
-			       AUTHORIZETYPE_CERT,
-			       certfile,
-			       strlen(certfile) + 1);
-#if defined(HAVE_LIBSASL2)
-	 else if (use_kerberos > 0) {
-	    d = authorization_create_response(
-		               server_response->authorization_data,
-			       AUTHORIZETYPE_SASL,
-			       "",
-			       1);
-	 }
-#endif
-	 else
-	    d = authorization_create_response(
-		              server_response->authorization_data,
-			      AUTHORIZETYPE_PASSWD,
-			      client_request->passphrase,
-			      strlen(client_request->passphrase) + 1);
-	 if (d == NULL) {
-	    verror_put_string("Cannot create authorization response");
-       	    goto end;
-	 }
-
-	 buffer = malloc(d->client_data_len + sizeof(int));
-	 if (!buffer) {
-	     verror_put_string("malloc() failed");
-	     goto end;
-	 }
-	 (*buffer) = d->method;
-	 bufferlen = d->client_data_len + sizeof(int);
-
-	 memcpy(buffer + sizeof(int), d->client_data, d->client_data_len);
-
-	 /* Send the authorization data to the server */
-	 if (myproxy_send(attrs, buffer, bufferlen) < 0) {
-	    goto end;
-	 }
-
-#if defined(HAVE_LIBSASL2)
-	 if (use_kerberos > 0) {
-		if (auth_sasl_negotiate_client(attrs, client_request) < 0)
-			goto end;
-	 }
-#endif
-
-      }
-      myproxy_free(NULL, NULL, server_response);
-      server_response = NULL;
-   } while (response_type == MYPROXY_AUTHORIZATION_RESPONSE);
-
-   return_status = 0;
-end:
-   myproxy_free(NULL, NULL, server_response);
-   if (buffer) free(buffer);
-
-   return return_status;
-}
-
-
-#if defined(HAVE_LIBSASL2)
-int send_response_sasl_data(myproxy_socket_attrs_t *attrs,
-    			myproxy_response_t* server_response,
-                        const char *data, int data_len)
-{
-    char client_buffer[SASL_BUFFER_SIZE], buf[SASL_BUFFER_SIZE];
-    int  bufferlen, len, result;
-
-    authorization_data_t*  auth_data;
-
-    sasl_encode64(data, data_len, buf, SASL_BUFFER_SIZE, &len);
-    buf[len] = '\0';
-    if (result != SASL_OK) {
-       verror_put_string(
-	          "Encoding data in base64 failed in send_response_sasl_data");
-       return -1;
-    }
-
-    auth_data = authorization_create_response(
-	               server_response->authorization_data,
-		       AUTHORIZETYPE_SASL,
-		       buf,
-		       len + 1);
-
-    if (auth_data == NULL) {
-	verror_put_string(
-	    "Cannot create authorization response in send_response_sasl_data");
-	return -1;
-    }
-
-    if (auth_data->client_data_len + sizeof(int) > sizeof(client_buffer)) {
-        verror_put_string("Internal buffer too small send_response_sasl_data");
-        return -1;
-    }
-
-    (*client_buffer) = AUTHORIZETYPE_SASL;
-    bufferlen = auth_data->client_data_len + sizeof(int);
-
-    memcpy(client_buffer + sizeof(int), auth_data->client_data,
-	   auth_data->client_data_len);
-
-    if (myproxy_send(attrs, client_buffer, bufferlen) < 0)
-       return -1;
-    return 0;
-}
-
-
-int recv_response_sasl_data(myproxy_socket_attrs_t *attrs,
-                        myproxy_response_t* server_response,
-                        char *data)
-{
-    char *response_data;
-    int result;
-    int len;
-    authorization_data_t*  auth_data;
-
-    if (myproxy_recv_response(attrs, server_response) < 0)
-        return -1;
-
-    auth_data = authorization_create_response(
-	               server_response->authorization_data,
-		       AUTHORIZETYPE_SASL,
-		       NULL,
-		       0);
-
-    response_data = auth_data->server_data;
-    result = sasl_decode64(response_data, strlen(response_data),
-		    data, SASL_BUFFER_SIZE, &len);
-    if (result != SASL_OK) {
-        verror_put_string("Decoding data from base64 failed.\n");
-        verror_put_errno(errno);
-        return -1;
-    }
-    data[len] = '\0';
-    return len;
-}
-
-
-static sasl_conn_t *conn = NULL;
-
-
-static int
-sasl_string_callback(void *context,
-		     int id,
-		     const char **result,
-		     unsigned *len)
-{
-    const char *value = (const char *)context;
-
-    if (! result)
-	return SASL_BADPARAM;
-
-    *result = value;
-    if (len)
-	*len = value ? strlen(value) : 0;
-
-    return SASL_OK;
-}
-
-
-static int
-sasl_secret_callback(sasl_conn_t *conn,
-		     void *context __attribute__((unused)),
-		     int id,
-		     sasl_secret_t **psecret)
-{
-    char password[MAX_PASS_LEN];
-    size_t len;
-
-    if (! conn || ! psecret || id != SASL_CB_PASS)
-	return SASL_BADPARAM;
-
-    if (myproxy_read_passphrase(password, MAX_PASS_LEN, "Password: ") < 0){
-	return SASL_FAIL;
-    }
-
-    len = strlen(password);
-
-    *psecret = (sasl_secret_t *) malloc(sizeof(sasl_secret_t) + len);
-
-    if (! *psecret) {
-	memset(password, 0, len);
-	return SASL_NOMEM;
-    }
-
-    (*psecret)->len = len;
-    strcpy((char *)(*psecret)->data, password);
-    memset(password, 0, len);
-
-    return SASL_OK;
-}
-
-
-static int
-sasl_prompt_callback(void *context __attribute__((unused)),
-		     int id,
-		     const char *challenge,
-		     const char *prompt,
-		     const char *defresult,
-		     const char **result,
-		     unsigned *len)
-{
-    char input[MAX_PASS_LEN];
-
-    if ((id != SASL_CB_ECHOPROMPT && id != SASL_CB_NOECHOPROMPT)
-	|| !prompt || !result || !len)
-	return SASL_BADPARAM;
-
-    if (! defresult)
-	defresult = "";
-
-    fputs(prompt, stdout);
-    if (challenge)
-	printf(" [challenge: %s]", challenge);
-    printf(" [%s]: ", defresult);
-    fflush(stdout);
-
-    if (id == SASL_CB_NOECHOPROMPT) {
-	if (myproxy_read_passphrase(input, MAX_PASS_LEN, "") < 0) {
-	    return SASL_FAIL;
-	}
-    } else {
-	fgets(input, 1024, stdin);
-    }
-    if (input[0])
-	*result = strdup(input);
-    else
-	*result = strdup(defresult);
-
-    memset(input, 0L, strlen(input));
-
-    if (! *result)
-	return SASL_NOMEM;
-
-    *len = strlen(*result);
-
-    return SASL_OK;
-}
-
-
-static int
-auth_sasl_negotiate_client(myproxy_socket_attrs_t *attrs,
-			   myproxy_request_t      *client_request)
-{
-    char server_buffer[SASL_BUFFER_SIZE];
-    const char *data;
-    int  len, server_len;
-
-    myproxy_response_t server_response;
-
-    sasl_callback_t callbacks[] = {
-	{ SASL_CB_USER, &sasl_string_callback, client_request->username },
-	{ SASL_CB_AUTHNAME, &sasl_string_callback, client_request->username },
-	{ SASL_CB_PASS, &sasl_secret_callback, NULL },
-	{ SASL_CB_ECHOPROMPT, &sasl_prompt_callback, NULL },
-	{ SASL_CB_NOECHOPROMPT, &sasl_prompt_callback, NULL },
-	{ SASL_CB_LIST_END, NULL, NULL }
-    };
-
-    int result;
-    sasl_security_properties_t secprops;
-    const char *chosenmech;
-    char *service = "myproxy",
-	*iplocal = NULL,
-        *ipremote = NULL;
-    char fqdn[1024];
-
-    strcpy(fqdn, attrs->pshost);
-
-    memset(server_buffer, 0, sizeof(*server_buffer));
-
-    result = sasl_client_init(callbacks);
-    if (result != SASL_OK) {
-        verror_put_string("Allocating sasl connection state failed");
-	return SASL_FAIL;
-    }
-
-    result = sasl_client_new(service, fqdn, iplocal, ipremote, NULL, 0, &conn);
-    if (result != SASL_OK) {
-        verror_put_string("Allocating sasl connection state failed");
-	return SASL_FAIL;
-    }
-
-    /* don't need integrity or privacy, since we're over SSL already.
-       in fact, let's disable them to avoid the overhead. */
-    memset(&secprops, 0L, sizeof(secprops));
-    result = sasl_setprop(conn, SASL_SEC_PROPS, &secprops);
-    if (result != SASL_OK) {
-        verror_put_string("Setting security properties failed");
-	return SASL_FAIL;
-    }
-
-    server_len = recv_response_sasl_data(attrs, &server_response,
-					 server_buffer);
-    if (server_len < 0) {
-       verror_put_string("SASL negotiation failed");
-       return SASL_FAIL;
-    }
-
-    myproxy_debug("Server sent SASL mechs %s.\n", server_buffer);
-
-    result = sasl_client_start(conn,
-                               server_buffer,
-                               NULL,
-                               &data,
-                               &len,
-                               &chosenmech);
-
-    if (result != SASL_OK && result != SASL_CONTINUE) {
-        verror_put_string("SASL error: %s\n", sasl_errdetail(conn));
-        return SASL_FAIL;
-    }
-
-    myproxy_debug("Using SASL mechanism %s\n", chosenmech);
-    strcpy(server_buffer, chosenmech);
-    if (data) {
-        if (SASL_BUFFER_SIZE - strlen(server_buffer) - 1 < len) {
-            verror_put_string("Not enough buffer space for SASL");
-	    return -1;
-        }
-        memcpy(server_buffer + strlen(server_buffer) + 1, data, len);
-        len += strlen(server_buffer) + 1;
-        data = NULL;
-    } else {
-        len = strlen(server_buffer);
-    }
-
-    send_response_sasl_data(attrs, &server_response, server_buffer, len);
-
-    authorization_data_free(server_response.authorization_data);
-
-    while (result == SASL_CONTINUE) {
-
-	server_len = recv_response_sasl_data(attrs, &server_response,
-					     server_buffer);
-        if (server_len < 0)
-	    return result;
-
-        result = sasl_client_step(conn, server_buffer, server_len, NULL,
-                              &data, &len);
-        if (result != SASL_OK && result != SASL_CONTINUE) {
-            verror_put_string("Performing SASL negotiation failed");
-	    return SASL_FAIL;
-        }
-        if (data && len) {
-	    send_response_sasl_data(attrs, &server_response, data, len);
-        } else if (result != SASL_OK) {
-	    send_response_sasl_data(attrs, &server_response, "", 0);
-        }
-
-	authorization_data_free(server_response.authorization_data);
-    }
-
-    myproxy_debug("SASL negotiation finished.");
-
-    return result;
-}
-#endif /* defined(HAVE_LIBSASL2) */


Comments clarification

Comments clarification

--- src/include/OSL/oslexec.h
+++ src/include/OSL/oslexec.h
@@ -148,6 +148,9 @@
     ///                              designated as the debug shaders.
     ///    string only_groupname  Compile only this one group (skip all others)
     ///
+    /// Note: the attributes referred to as "string" are actually on the app
+    /// side as ustring or const char* (they have the same data layout), NOT
+    /// std::string!
     bool attribute (string_view name, TypeDesc type, const void *val);

     // Shortcuts for common types
@@ -231,7 +234,7 @@
     ///   int num_textures_needed    The number of texture names that are
     ///                                known to be potentially needed by the
     ///                                group (after optimization).
-    ///   ustring textures_needed[]  The names of the textures known to be
+    ///   string textures_needed[]   The names of the textures known to be
     ///                                needed. Must be of length at least as
     ///                                long as num_textures_needed.
     ///   int unknown_textures_needed  Nonzero if additional textures may be
@@ -246,8 +249,11 @@
     ///   ptr userdata_offsets       Retrieves a pointer to the array of
     ///                                 int describing the userdata offsets
     ///                                 within the heap.
-    ///   ustring pickle             Retrieves a serialized representation
+    ///   string pickle              Retrieves a serialized representation
     ///                                 of the shader group declaration.
+    /// Note: the attributes referred to as "string" are actually on the app
+    /// side as ustring or const char* (they have the same data layout), NOT
+    /// std::string!
     bool getattribute (ShaderGroup *group, string_view name,
                        TypeDesc type, void *val);
     // Shortcuts for common types


Expose Iterator/Accessor API for Inlist.

SVN revision: 35447

--- src/include/eina_inlist.h
+++ src/include/eina_inlist.h
@@ -20,6 +20,8 @@
 #define EINA_INLIST_H_

 #include "eina_types.h"
+#include "eina_iterator.h"
+#include "eina_accessor.h"

 /**
  * @defgroup Inline_List_Group Inline List
@@ -43,6 +45,9 @@
 EAPI void * eina_inlist_remove(void *in_list, void *in_item);
 EAPI void * eina_inlist_find(void *in_list, void *in_item);

+EAPI Eina_Iterator *eina_inlist_iterator_new(const void *in_list);
+EAPI Eina_Accessor *eina_inlist_accessor_new(const void *in_list);
+
 #define EINA_INLIST_ITER_NEXT(list, l) for (l = (void*)(Eina_Inlist *)list; l; l = (void*)((Eina_Inlist *)l)->next)
 #define EINA_INLIST_ITER_LAST(list, l) for (l = (void*)((Eina_Inlist *)list)->last; l; l = (void*)((Eina_Inlist *)l)->prev)


Forgotten declaration.

Forgotten declaration.

SVN revision: 35275

--- src/include/eina_module.h
+++ src/include/eina_module.h
@@ -15,7 +15,10 @@

 EAPI Eina_Module * eina_module_new(const char *file);
 EAPI void eina_module_free(Eina_Module *m);
+
+EAPI int eina_module_load(Eina_Module *m);
 EAPI void eina_module_unload(Eina_Module *m);
+
 EAPI char * eina_module_path_get(Eina_Module *m);
 EAPI char * eina_module_name_get(Eina_Module *m);
 EAPI void * eina_module_symbol_get(Eina_Module *m, const char *symbol);


:bulb: Update comments

:bulb: Update comments

--- src/include/elem_struct.h
+++ src/include/elem_struct.h
@@ -654,8 +654,8 @@

 typedef struct cstate_struct
 {
-    double          SOC_Mass[MAXLYR];       /* Soil organic carbon (kg m-2) */
-    double          MBC_Mass[MAXLYR];       /* Microbial biomass C (kg m-2) */
+    double          SOC_Mass[MAXLYR];       /* soil organic carbon (kg m-2) */
+    double          MBC_Mass[MAXLYR];       /* microbial biomass C (kg m-2) */
     double          stanResidueMass;        /* (kg m-2) */
     double          flatResidueMass;        /* (kg m-2) */
     double          manureSurfaceC;         /* (kg m-2) */
@@ -667,13 +667,13 @@

 typedef struct cflux_struct
 {
-    double          C_Humified;             /* Carbon humified from residues,
+    double          C_Humified;             /* carbon humified from residues,
                                              * roots, rizho, and manure
                                              * (kg m-2 day-1)*/
-    double          C_ResidueRespired;      /* Carbon respired from residues,
+    double          C_ResidueRespired;      /* carbon respired from residues,
                                              * roots, rizho, and manure
                                              * (kg m-2 day-1)*/
-    double          C_SoilRespired;         /* Carbon respired from soil
+    double          C_SoilRespired;         /* carbon respired from soil
                                              * organic carbon only
                                              * (kg m-2 day-1)*/
     double          carbonRespired[MAXLYR]; /* kg m-2 day-1 */
@@ -683,8 +683,8 @@
 {
     double          no3[MAXLYR];            /* nitrate (kg m-2) */
     double          nh4[MAXLYR];            /* ammonium (kg m-2) */
-    double          SON_Mass[MAXLYR];       /* Soil organic N (kg m-2) */
-    double          MBN_Mass[MAXLYR];       /* Microbial biomass N (kg m-2) */
+    double          SON_Mass[MAXLYR];       /* soil organic N (kg m-2) */
+    double          MBN_Mass[MAXLYR];       /* microbial biomass N (kg m-2) */
     double          stanResidueN;           /* (kg m-2) */
     double          flatResidueN;           /* (kg m-2) */
     double          manureSurfaceN;         /* (kg m-2) */


Fix a typo

Fix a typo

--- src/include/plibc/plibc.h
+++ src/include/plibc/plibc.h
@@ -364,7 +364,7 @@
 /* Make sure it's the same as WSATIMEDOUT */
 #  define ETIMEDOUT 138		/* Connection timed out */
 #endif
-#if !defined(EWOULDBLOCK) || EWOULBLOCK == 140
+#if !defined(EWOULDBLOCK) || EWOULDBLOCK == 140
 #  undef EWOULDBLOCK /* MinGW-w64 defines it as 140, but we want it as EAGAIN */
 #  define EWOULDBLOCK EAGAIN	/* Operation would block */
 #endif


refactor(Initiation): Reorganize SIP types file

--- src/initiation/siptypes.h
+++ src/initiation/siptypes.h
@@ -4,6 +4,24 @@
 #include <QList>

 #include <memory>
+
+
+/* notes on expansion of the SIP structures such as SIPDialogInfo,
+ * SIPMessageInfo, SIPRequest and SIPResponse with new SIP message extensions.
+
+ * If you want to add support for a new parameter to SIP message:
+ * 1) add the parameter to desired struct,
+ * 2) compose the parameter using tryAddParameter in sipfieldcomposing withing desired field and
+ * 3) parse parameter using parseParameterNameToValue in sipfieldparsing
+
+ * If you want to add support for a new field to SIP message:
+ * 1) add field values to desired structs,
+ * 2) add a function for composing the message to sipfieldcomposing
+ * 3) use the composing function in SIPTransport
+ * 4) add a function for field parsing to sipfieldparsing and
+ * 5) add the parsing function to parsing map at the start of siptransport
+ */
+

 // See RFC 3261 for INVITE, ACK, BYE, CANCEL, OPTIONS and REGISTER
 // See RFC 3262 for PRACK
@@ -95,41 +113,31 @@
                    SIP_UNWANTED = 607}; // RFC 3261

-
-
-
 // 7 is the length of preset string
 const uint32_t BRANCHLENGTH = 32 - 7;

-
-// SIPParameter and SIPField are used as an intermediary step in composing and parsing SIP messages
 struct SIPParameter
 {
   QString name;
   QString value; // optional
 };

-// one set of values for a SIP field. Separated by commas
-struct ValueSet
-{
-  QStringList words;
-  std::shared_ptr<QList<SIPParameter>> parameters;
-};
-
-struct SIPField
-{
-  QString name;
-  QList<ValueSet> valueSets; // separated by comma(,)
-};
-
-struct hostport
+
+struct URIHeader
+{
+  QString hname;
+  QString hvalue;
+};
+
+
+struct Hostport
 {
   QString host; // hostname / IPv4address / IPv6reference
-  uint16_t port = 0; // omitted if 0
-};
-
-struct userinfo
+  uint16_t port = 0; // optional, omitted if 0
+};
+
+struct Userinfo
 {
   QString user; // could also be telephone-subscriber
   QString password = ""; // omitted if empty
@@ -143,13 +151,15 @@
 struct SIP_URI
 {
   SIPType type;
-  userinfo userinfo;
-
+  Userinfo userinfo; // optional
+
+  // TODO: this does not belong to uri
   QString realname; // omitted if empty

-  hostport hostport;
+  Hostport hostport;

   QList<SIPParameter> uri_parameters;
+  QList<URIHeader> headers;
 };

 enum Transport {NONE, UDP, TCP, TLS, SCTP, OTHER};
@@ -178,21 +188,7 @@
   uint32_t length;  // set by SIPTransport
 };

-/* notes on expansion of the SIP structures such as SIPDialogInfo,
- * SIPMessageInfo, SIPRequest and SIPResponse with new SIP message extensions.
-
- * If you want to add support for a new parameter to SIP message:
- * 1) add the parameter to desired struct,
- * 2) compose the parameter using tryAddParameter in sipfieldcomposing withing desired field and
- * 3) parse parameter using parseParameterNameToValue in sipfieldparsing
-
- * If you want to add support for a new field to SIP message:
- * 1) add field values to desired structs,
- * 2) add a function for composing the message to sipfieldcomposing
- * 3) use the composing function in SIPTransport
- * 4) add a function for field parsing to sipfieldparsing and
- * 5) add the parsing function to parsing map at the start of siptransport
- */
+

 const uint16_t CALLIDLENGTH = 16;
 const uint16_t TAGLENGTH = 16;
@@ -205,7 +201,7 @@
   QString callID; // in form callid@host
 };

-// TODO: Enable recording of several valuesets in SIPMessage
+

 // Identifies the SIP message and the transaction it belongs to as well as participants
 struct SIPMessageInfo
@@ -251,3 +247,21 @@
 };

+// these structs are used as a temporary step in parsing and composing SIP messages
+// TODO: Enable recording of several valuesets in SIPMessage
+
+// one set of values for a SIP field. Separated by commas
+struct ValueSet
+{
+  QStringList words;
+  std::shared_ptr<QList<SIPParameter>> parameters;
+};
+
+struct SIPField
+{
+  QString name;
+  QList<ValueSet> valueSets; // separated by comma(,)
+};
+
+
+


[#35] Remove unused PPC FW_CFG and BAUD definitions.

--- arch/ppc/ppc.h
+++ arch/ppc/ppc.h
@@ -55,13 +55,4 @@
     ARCH_MAC99_U3,
 };

-#define FW_CFG_PPC_WIDTH	(FW_CFG_ARCH_LOCAL + 0x00)
-#define FW_CFG_PPC_HEIGHT	(FW_CFG_ARCH_LOCAL + 0x01)
-#define FW_CFG_PPC_DEPTH	(FW_CFG_ARCH_LOCAL + 0x02)
-#define FW_CFG_PPC_TBFREQ	(FW_CFG_ARCH_LOCAL + 0x03)
-#define FW_CFG_PPC_IS_KVM       (FW_CFG_ARCH_LOCAL + 0x05)
-#define FW_CFG_PPC_KVM_HC       (FW_CFG_ARCH_LOCAL + 0x06)
-#define FW_CFG_PPC_KVM_PID      (FW_CFG_ARCH_LOCAL + 0x07)
-
-#define PPC_SERIAL_MM_BAUDBASE 399193
 #endif


asm/assemble.c: change the overflow handling for signed byte immediates

For byte immediates that are sign-extended to a wider operand size,
simplify the code and make the warning code behave as what is
expected.

Signed-off-by: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@linux.intel.com>

--- asm/assemble.c
+++ asm/assemble.c
@@ -1748,34 +1748,28 @@

         case4(0274):
         {
-            uint64_t uv, um;
+            int64_t uv;
             int s;

-            if (ins->rex & REX_W)
-                s = 64;
-            else if (ins->prefixes[PPS_OSIZE] == P_O16)
-                s = 16;
-            else if (ins->prefixes[PPS_OSIZE] == P_O32)
-                s = 32;
-            else
-                s = bits;
-
-            um = (uint64_t)2 << (s-1);
-            uv = opx->offset;
-
-            if (uv > 127 && uv < (uint64_t)-128 &&
-                (uv < um-128 || uv > um-1)) {
-                /* If this wasn't explicitly byte-sized, warn as though we
-                 * had fallen through to the imm16/32/64 case.
+            if (absolute_op(opx)) {
+                if (ins->rex & REX_W)
+                    s = 64;
+                else if (ins->prefixes[PPS_OSIZE] == P_O16)
+                    s = 16;
+                else if (ins->prefixes[PPS_OSIZE] == P_O32)
+                    s = 32;
+                else
+                    s = bits;
+
+                /*
+                 * Forcibly discard bits irrelevant for our needs, to
+                 * prevent bogus warnings.
                  */
-                nasm_error(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV,
-                        "%s value exceeds bounds",
-                        (opx->type & BITS8) ? "signed byte" :
-                        s == 16 ? "word" :
-                        s == 32 ? "dword" :
-                        "signed dword");
+                uv = opx->offset;
+                uv = (uv << (64-s)) >> (64-s);
+                opx->offset = uv;
             }
-            out_imm(data, opx, 1, OUT_WRAP); /* XXX: OUT_SIGNED? */
+            out_imm(data, opx, 1, OUT_SIGNED);
             break;
         }


Add a little string safety by zeroing CommandOptions.

--- flake/flake.c
+++ flake/flake.c
@@ -322,6 +322,7 @@
     float kb, sec, kbps, wav_bytes;
     char *omethod_s, *stmethod_s, *ptype_s, *vbs_s;

+    memset(&opts, 0, sizeof(CommandOptions));
     err = parse_commandline(argc, argv, &opts);
     if(!opts.quiet) {
         fprintf(stderr, "\nFlake: FLAC audio encoder\n(c) 2006  Justin Ruggles\n\n");


git-svn-id: https://www.imagemagick.org/subversion/ImageMagick/trunk@10103 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74

--- MagickCore/magick-config.h
+++ MagickCore/magick-config.h
@@ -117,6 +117,7 @@
 #ifndef MAGICKCORE_SHAREARCH_RELATIVE_PATH
 #define MAGICKCORE_SHAREARCH_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME
 #endif
+
 #endif

 #if defined(__cplusplus) || defined(c_plusplus)


ARMv8: disable alignment checking to allow unaligned accesses

Signed-off-by: Reto Achermann <66f6ea3e040423755b3cf26edfe6c7fb1f9adc27@inf.ethz.ch>

--- kernel/arch/armv8/tmas/vminit.c
+++ kernel/arch/armv8/tmas/vminit.c
@@ -98,7 +98,7 @@
             BIT(4)  | /* Check stack alignment at EL0 */
             BIT(3)  | /* Check stack alignment at EL1 */
             BIT(2)  | /* Data is cacheable */
-            BIT(1)  | /* Alignment checking */
+          //  BIT(1)  | /* Alignment checking */
             BIT(0)  ; /* EL0/1 translation enabled */
         sysreg_write_sctlr_el1(sctlr);


Bug fix in fmpq_poly_set_coeff_mpq (result was not in lowest terms)

--- fmpq_poly/set_coeff_mpq.c
+++ fmpq_poly/set_coeff_mpq.c
@@ -34,27 +34,39 @@
 void fmpq_poly_set_coeff_mpq(fmpq_poly_t poly, long n, const mpq_t x)
 {
     long len = poly->length;
-    int replace = (n < len && *(poly->coeffs + n) != 0L);
-
+    int replace = (n < len && !fmpz_is_zero(poly->coeffs + n));
+
     if (!replace && mpq_sgn(x) == 0)
         return;
-
+
     if (n + 1 > len)
     {
-        fmpq_poly_fit_length(poly, n + 1);
+        fmpq_poly_fit_length(poly, n + 1);
         len = n + 1;
         poly->length = len;
     }
-
+
     if (replace)
     {
         fmpz_t c;
-        fmpz_t t;
+        fmpz_t num, den;
+
         fmpz_init(c);
-        fmpz_init(t);
-
-        fmpz_set_mpz(poly->coeffs + n, mpq_numref(x));
-        _fmpz_vec_content(c, poly->coeffs, len);
+        fmpz_init(num);
+        fmpz_init(den);
+
+        fmpz_set_mpz(num, mpq_numref(x));
+        fmpz_set_mpz(den, mpq_denref(x));
+
+        fmpz_zero(poly->coeffs + n);
+        _fmpz_poly_content(c, poly->coeffs, len);
+        _fmpz_vec_scalar_mul_fmpz(poly->coeffs, poly->coeffs, len, den);
+        fmpz_mul(c, c, den);
+
+        fmpz_mul(poly->coeffs + n, num, poly->den);
+        fmpz_gcd(c, c, poly->coeffs + n);
+        fmpz_mul(poly->den, poly->den, den);
+
         if (*c != 1L)
             fmpz_gcd(c, c, poly->den);
         if (*c != 1L)
@@ -62,25 +74,31 @@
             _fmpz_vec_scalar_divexact_fmpz(poly->coeffs, poly->coeffs, len, c);
             fmpz_divexact(poly->den, poly->den, c);
         }
+        _fmpq_poly_normalise(poly);
+
+        fmpz_clear(c);
+        fmpz_clear(num);
+        fmpz_clear(den);
+    }
+    else
+    {
+        fmpz_t d, t;
+
+        fmpz_init(d);
+        fmpz_init(t);
         fmpz_set_mpz(t, mpq_denref(x));
+
+        fmpz_gcd(d, poly->den, t);
+        fmpz_divexact(t, t, d);
+
         _fmpz_vec_scalar_mul_fmpz(poly->coeffs, poly->coeffs, len, t);
         fmpz_set_mpz(poly->coeffs + n, mpq_numref(x));
         fmpz_mul(poly->coeffs + n, poly->coeffs + n, poly->den);
-        fmpz_mul(poly->den, t, poly->den);
-
-        _fmpq_poly_normalise(poly);
-        fmpz_clear(c);
-        fmpz_clear(t);
-    }
-    else
-    {
-        fmpz_t t;
-        fmpz_init(t);
-        fmpz_set_mpz(t, mpq_denref(x));
-        _fmpz_vec_scalar_mul_fmpz(poly->coeffs, poly->coeffs, len, t);
-        fmpz_set_mpz(poly->coeffs + n, mpq_numref(x));
-        fmpz_mul(poly->coeffs + n, poly->coeffs + n, poly->den);
-        fmpz_mul(poly->den, t, poly->den);
+        fmpz_divexact(poly->coeffs + n, poly->coeffs + n, d);
+
+        fmpz_mul(poly->den, poly->den, t);
+
+        fmpz_clear(d);
         fmpz_clear(t);
     }
 }