make 16-cycle retry timeout the default, it seems to be needed for Creative hardware. SB 2.0 cards don't have busy cycles but they have a slow enough DAC in Direct DAC mode that you need to poll and timeout anyway.

--- hw/sndsb/sndsb.c
+++ hw/sndsb/sndsb.c
@@ -644,7 +644,7 @@
 	cx->timer_tick_func = NULL;
 	cx->poll_ack_when_no_irq = 1;
 	cx->reason_not_supported = NULL;
-	cx->dsp_direct_dac_poll_retry_timeout = 0;
+	cx->dsp_direct_dac_poll_retry_timeout = 16; /* assume at least 16 I/O reads to wait for DSP ready */
 	cx->dsp_direct_dac_read_after_command = 0;
 	cx->windows_creative_sb16_drivers_ver = 0;
 	cx->windows_creative_sb16_drivers = 0;
@@ -1027,8 +1027,6 @@
 	}

 	if (cx->dsp_vmaj >= 4) {
-		/* Direct DAC output can work, but apparently it takes the DSP a few tries even after the sample interval */
-		cx->dsp_direct_dac_poll_retry_timeout = 16;
 		/* Highspeed DSP commands don't matter anymore, they're just an alias to older commands */
 		cx->hispeed_matters = 0;
 		cx->hispeed_blocking = 0;
@@ -1054,6 +1052,7 @@
 	}
 	else if (cx->dsp_vmaj == 3) {
 		if (cx->is_gallant_sc6600) { /* SC-6600 clone card */
+			cx->dsp_direct_dac_poll_retry_timeout = 4; /* DSP is responsive to direct DAC to allow lesser timeout */
 			/* NTS: Officially, the max sample rate is 24000Hz, but the DSP seems to allow up to 25000Hz,
 			 *      then limit the sample rate to that up until about 35000Hz where it suddenly clamps
 			 *      the rate down to 24000Hz. Mildly strange bug. */


Fix: don't break the ABI (ContextPropertyInfo is a public class).

--- libcontextsubscriber/src/contextpropertyinfo.h
+++ libcontextsubscriber/src/contextpropertyinfo.h
@@ -64,6 +64,10 @@

 private:
     QString keyName; ///< The name of the key his ContextPropertyInfo represents.
+    QString cachedDoc; ///< Only for binary compatibility; this member cannot be removed.
+    ContextTypeInfo cachedTypeInfo; ///< Only for binary compatibility; this member cannot be removed.
+    bool cachedDeclared; ///< Only for binary compatibility; this member cannot be removed.
+
     QList<ContextProviderInfo> cachedProviders; ///< Cached list of providers for this key.
     mutable QMutex cacheLock; ///< Lock for the cache.


Don't print journalctl command when cancelled

No need to print out lots of detailed information if the user
actually cancelled the operation. Just go away. Also when the
polkit prompt is cancelled

https://bugs.freedesktop.org/show_bug.cgi?id=64539

--- tools/realm.c
+++ tools/realm.c
@@ -73,14 +73,24 @@
 {
 	static gboolean diag_hint = TRUE;
 	GString *message;
+	gchar *remote;
 	va_list va;

+	if (realm_cancelled &&
+	    g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+		g_error_free (error);
+		return;
+	}
+
 #ifdef WITH_JOURNAL
-	if (diag_hint && realm_operation_id && !realm_verbose) {
+	remote = error ? g_dbus_error_get_remote_error (error) : NULL;
+	if (diag_hint && realm_operation_id && !realm_verbose &&
+	    g_strcmp0 (remote, REALM_DBUS_ERROR_NOT_AUTHORIZED) != 0) {
 		g_printerr ("See: journalctl REALMD_OPERATION=%s\n",
 		            realm_operation_id);
 		diag_hint = FALSE;
 	}
+	g_free (remote);
 #endif

 	message = g_string_new ("");


Have stronger debugging in case the board is corrupt.

--- check.c
+++ check.c
@@ -1,3 +1,5 @@
+#include <assert.h>
+
 #include "board.h"
 #include "pieces.h"
 #include "check.h"
@@ -61,8 +63,10 @@
     case BLACK_PAWN:
         return BLACK;

+    default:
+        assert(board[rank][file] == BLANK_SQUARE);
+     /* Fall through. */
     case BLANK_SQUARE:
-    default:
         return (game_state.player_turn);
     }
 }


more doxygen markup

more doxygen markup

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

--- libgphoto2_port/libgphoto2_port/gphoto2-port.c
+++ libgphoto2_port/libgphoto2_port/gphoto2-port.c
@@ -24,7 +24,6 @@
  */

 #include "config.h"
-#include <gphoto2/gphoto2-port.h>

 #include <stdarg.h>
 #include <stdlib.h>
@@ -34,7 +33,6 @@
 #include <ltdl.h>

 #include <gphoto2/gphoto2-port-result.h>
-#include <gphoto2/gphoto2-port-info-list.h>
 #include <gphoto2/gphoto2-port-library.h>
 #include <gphoto2/gphoto2-port-log.h>

@@ -58,7 +56,7 @@
 #define CHECK_INIT(p) {if (!(p)->pc->ops) {gp_port_set_error ((p), _("The port has not yet been initialized")); return (GP_ERROR_BAD_PARAMETERS);}}

 /**
- * \internal
+ * \brief Internal private libgphoto2_port data.
  * This structure contains private data.
  **/
 struct _GPPortPrivateCore {
@@ -130,8 +128,10 @@
 /**
  * \brief Configure a port
  *
- * Makes a port functional. After calling this function, you can
- * access the port using for example gp_port_open().
+ * Makes a port functional by passing in the necessary path
+ * information (from the serial:/dev/ttyS0 or similar variables).
+ * After calling this function, you can access the port using for
+ * example gp_port_open().
  *
  * \param port a GPPort
  * \param info the GPPortInfo to set
@@ -221,6 +221,8 @@
 /**
  * \brief Retreives information about the port.
  *
+ * Retrieves the informations set by gp_port_set_info().
+ *
  * \param port a GPPort
  * \param info GPPortInfo
  * \return a gphoto2 error code
@@ -326,12 +328,15 @@

 /**
  * \brief Writes a specified amount of data to a port.
+
  * \param port a #GPPort
  * \param data the data to write to the port
  * \param size the number of bytes to write to the port
  *
- *
- * \return a gphoto2 error code
+ * Writes data to the port. On non-serial ports the amount of data
+ * written is returned (and not just GP_OK).
+ *
+ * \return a negative gphoto2 error code or the amount of data written.
  **/
 int
 gp_port_write (GPPort *port, const char *data, int size)
@@ -365,8 +370,9 @@
  * \param size the number of bytes that should be read
  *
  * Reads a specified number of bytes from the port into the supplied buffer.
- *
- * \return a gphoto2 error code
+ * It returns the number of bytes read or a negative error code.
+ *
+ * \return a gphoto2 error code or the amount of data read
  **/
 int
 gp_port_read (GPPort *port, char *data, int size)
@@ -399,7 +405,7 @@
  * \param data a pointer to an allocated buffer
  * \param size the number of bytes that should be read
  *
- * Reads a specified number of bytes from the inerrupt endpoint
+ * Reads a specified number of bytes from the interrupt endpoint
  * into the supplied buffer.
  * Function waits port->timeout miliseconds for data on interrupt endpoint.
  *
@@ -429,6 +435,7 @@
 	return (retval);
 }

+/** The timeout in milliseconds for fast interrupt reads. */
 #define FAST_TIMEOUT	50
 /**
  * \brief Check for interrupt without wait


fully optimized piece map data interpretation


virsh: Fix ordering of arguments when calling vshCalloc.

In vshSnapshotListCollect() vshCalloc was called with swapped nmemb and
size argument. This caused division by zero in xalloc_oversized as the
macro doesn't expect size to be zero.

--- tools/virsh.c
+++ tools/virsh.c
@@ -17200,8 +17200,8 @@
     if (count >= 0) {
         /* When mixing --from and --tree, we also want a copy of from
          * in the list, but with no parent for that one entry.  */
-        snaplist->snaps = vshCalloc(ctl, sizeof(*snaplist->snaps),
-                                    count + (tree && from));
+        snaplist->snaps = vshCalloc(ctl, count + (tree && from),
+                                    sizeof(*snaplist->snaps));
         snaplist->nsnaps = count;
         for (i = 0; i < count; i++)
             snaplist->snaps[i].snap = snaps[i];


Forward declarations need to be in the right namespace...

--- libmesh/include/mesh/mesh_triangle_interface.h
+++ libmesh/include/mesh/mesh_triangle_interface.h
@@ -32,12 +32,12 @@
 #include "libmesh.h"
 #include "mesh_serializer.h"

-// Forward Declarations
-
-class UnstructuredMesh;
-
 namespace libMesh
 {
+
+  // Forward Declarations
+
+  class UnstructuredMesh;

   /**
    * A C++ interface between LibMesh and the Triangle library written by


删除多余空格

删除多余空格

--- bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c
+++ bsp/stm32/stm32l475-atk-pandora/board/ports/sdcard_port.c
@@ -65,9 +65,6 @@
         }
     }

-
-
-
     return RT_EOK;
 }
 INIT_APP_EXPORT(stm32_sdcard_mount);


Fix a warning from tcc.

Fix a warning from tcc.

Squash is still not able to build with tcc, apparently due to a problem
with libtool passing it an option it doesn't understand when building
the plugins.

Signed-off-by: Evan Nemerson <178b62e73cc3fab9e30bf27b2372c9ff92401915@coeus-group.com>

--- squash/ini.c
+++ squash/ini.c
@@ -186,7 +186,7 @@
 	SQUASH_INI_PARSER_STATE_ESCAPED  = 8
 } SquashIniParserState;

-SquashIniParserError
+int
 squash_ini_parser_parse (SquashIniParser* parser, FILE* input) {
   char line[SQUASH_INI_PARSER_MAX_LINE] = { 0, };
   int line_num = 0;


Make i3_default_sock_path a local variable

--- i3bar/src/main.c
+++ i3bar/src/main.c
@@ -18,7 +18,6 @@

 #include "common.h"

-char *i3_default_sock_path = "~/.i3/ipc.sock";

 char *expand_path(char *path) {
     static glob_t globbuf;
@@ -52,6 +51,7 @@
     char *socket_path = NULL;
     char *command = NULL;
     char *fontname = NULL;
+    char *i3_default_sock_path = "~/.i3/ipc.sock";

     /* Definition of the standard-config */
     config.hide_on_modifier = 0;


Refactoring code

Refactoring code

--- hackterm.c
+++ hackterm.c
@@ -61,11 +61,10 @@
 char **passwords;
 int curY, curX;

-
-void printregisters();
+void setup();
 void printinputarea();
 void printboard();
-void pushMessage(const char *newMessage);
+void pushmessage(const char *newMessage);
 int tryPassword();
 void removeDud();
 void addPasswordsToBoard();
@@ -94,28 +93,9 @@
 		printf("       minimum size of 24x56 to run.\n");
 		return 0;
 	}
-
-
-	// Board Set-up ///////////////////////////////////////////////////////////
-	messages = malloc( sizeof(char*) * MAX_MESSAGES); //TODO: free
-	hacks = malloc( sizeof(char*) * NUM_PASSWORDS);   //TODO: free
-	passwords = malloc( sizeof(char*) * NUM_HACKS);   //TODO: free
-	mvprintw(1, 1, "ROBCO INDUSTRIES (TM) TERMLINK PROTOCOL\n ENTER PASSWORD NOW\n");
-
-	// add trash to board
-	int i;
-	for (i = 0; i < 408; i++) {
-		board[i] = genTrash();
-	}
-
-	genPasswords();
-	addPasswordsToBoard();
-
-	printregisters();
-
-	move(6, 8);
-
-	getyx(stdscr, curY, curX);		// Get the cursor position and assign to curY, curX
+
+	setup();
+
 	int trysLeft = 4;

 	while (1) {
@@ -158,9 +138,9 @@

 		refresh();

-		// getting user input from keyboard
-		int uInput = getch();
-		usleep(10); // Reduces cursor jump when arrows are held down
+
+		int uInput = getch();	// Get user input from keyboard (pause)
+		usleep(10); 			// Reduces cursor jump if arrows are held down

 		switch (uInput) {
 		case KEY_UP :
@@ -207,9 +187,29 @@
 	return 0;
 }

-void printregisters() {
+void setup() {
+
+	curY = 6; //TODO: think about defining 6,8 as START_X
+	curX = 8; //                              and START_Y
+
+	// Board Set-up ////////////////////////////////////////////////////////////
+	messages = malloc( sizeof(char*) * MAX_MESSAGES); //TODO: free
+	hacks = malloc( sizeof(char*) * NUM_PASSWORDS);   //TODO: free
+	passwords = malloc( sizeof(char*) * NUM_HACKS);   //TODO: free
+	mvprintw(1, 1, "ROBCO INDUSTRIES (TM) TERMLINK PROTOCOL\n ENTER PASSWORD NOW\n");
+
+	// Populate Entire Board with Trash ////////////////////////////////////////
+	int i;
+	for (i = 0; i < 408; i++) {
+		board[i] = genTrash();
+	}
+
+	genPasswords();
+	addPasswordsToBoard();
+
+	// Print Registers /////////////////////////////////////////////////////////
 	int numregisters = 17;
-	int i;
+
 	for (i = 0; i < numregisters; i++) {
 		mvprintw(6+i, 1, "%s", registers[i]);
 		mvprintw(6+i, 21, "%s", registers[i+17]);
@@ -233,7 +233,7 @@
 	}
 }

-void pushMessage(const char *newMessage) {
+void pushmessage(const char *newMessage) {
 	char *fullMsg = "             ";
 	fullMsg = (char*) newMessage;

@@ -246,8 +246,8 @@

 int tryPassword() { // Unimplemented
 	// If hack
-		//pushMessage(hackContents);
-		//pushMessage("Dud removed.");
+		//pushmessage(hackContents);
+		//pushmessage("Dud removed.");
 		//prints 2 lines
 	// If wrong password
 		// prints 3 lines
@@ -259,8 +259,8 @@
 }

 void removeDud() {
-	pushMessage(">Dud removed.");
-	pushMessage(">[*(>]       ");
+	pushmessage(">Dud removed.");
+	pushmessage(">[*(>]       ");
 }

 void addPasswordsToBoard() {


Made template constructor explicit to prevent infinit loop when no conversion can be found.

--- n/core/String.h
+++ n/core/String.h
@@ -64,7 +64,7 @@
 		typedef char const * const_iterator;

 		template<typename T>
-		String(const T &s) : String() {
+		explicit String(const T &s) : String() {
 			//buildDispatch(s, BoolToType<TypeConversion<typename AsCollection<T>::ElementType, const char>::exists>());
 			buildDispatch(s, BoolToType<AsCollection<T>::isCollection>());
 		}
@@ -219,6 +219,9 @@
 			operator=(oss.str().c_str());
 		}

+		void buildDispatch(const String &t, FalseType) {
+			operator=(t);
+		}

 		void buildDispatch(const bool &t, FalseType) {
 			std::ostringstream oss;


i8250: No need to declare a variable to declare a struct

--- hw/isa/i8250.h
+++ hw/isa/i8250.h
@@ -1,5 +1,5 @@
 #pragma once

-struct vm *pVM;
+struct vm;

 int hw_isa_i8250_init(struct vm *pVM);


i965_drv_video: [H.264] fix slice_data_bit_offset

VASliceParameterBufferH264.slice_data_bit_offset will point into the part
of slice header if there are some escaped bytes in the slice header. The offset
to slice data is needed for BSD unit so that BSD unit can fetch right slice data
for processing. This fixes conformance case BASQP1_Sony_C.jsv

The method to get the total number of bytes in the slice header is provided by Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>

--- i965_avc_bsd.c
+++ i965_avc_bsd.c
@@ -566,11 +566,41 @@
     ADVANCE_BCS_BATCH(ctx);
 }

+/*
+ * Return the bit offset to the first bit of the slice data
+ *
+ * VASliceParameterBufferH264.slice_data_bit_offset will point into the part
+ * of slice header if there are some escaped bytes in the slice header. The offset
+ * to slice data is needed for BSD unit so that BSD unit can fetch right slice data
+ * for processing. This fixes conformance case BASQP1_Sony_C.jsv
+ */
+static int
+i965_avc_bsd_get_slice_bit_offset(uint8_t *buf, int mode_flag, int in_slice_data_bit_offset)
+{
+    int out_slice_data_bit_offset;
+    int slice_header_size = in_slice_data_bit_offset / 8;
+    int i, j;
+
+    for (i = 0, j = 0; i < slice_header_size; i++, j++) {
+        if (!buf[j] && !buf[j + 1] && buf[j + 2] == 3) {
+            i++, j += 2;
+        }
+    }
+
+    out_slice_data_bit_offset = 8 * j + in_slice_data_bit_offset % 8;
+
+    if (mode_flag == ENTROPY_CABAC)
+        out_slice_data_bit_offset = ALIGN(out_slice_data_bit_offset, 0x8);
+
+    return out_slice_data_bit_offset;
+}
+
 static void
 g4x_avc_bsd_object(VADriverContextP ctx,
                    struct decode_state *decode_state,
                    VAPictureParameterBufferH264 *pic_param,
-                   VASliceParameterBufferH264 *slice_param)
+                   VASliceParameterBufferH264 *slice_param,
+                   int slice_index)
 {
     int width_in_mbs = pic_param->picture_width_in_mbs_minus1 + 1;
     int height_in_mbs = pic_param->picture_height_in_mbs_minus1 + 1; /* frame height */
@@ -585,6 +615,7 @@
         int weighted_pred_idc = 0;
         int first_mb_in_slice = 0;
         int slice_type;
+        uint8_t *slice_data = NULL;

         encrypted = 0; /* FIXME: which flag in VAAPI is used for encryption? */

@@ -594,10 +625,12 @@
         } else
             cmd_len = 8;

-        slice_data_bit_offset = slice_param->slice_data_bit_offset;
-
-        if (pic_param->pic_fields.bits.entropy_coding_mode_flag == ENTROPY_CABAC)
-            slice_data_bit_offset = ALIGN(slice_data_bit_offset, 0x8);
+        dri_bo_map(decode_state->slice_datas[slice_index]->bo, 0);
+        slice_data = (uint8_t *)(decode_state->slice_datas[slice_index]->bo->virtual + slice_param->slice_data_offset);
+        slice_data_bit_offset = i965_avc_bsd_get_slice_bit_offset(slice_data,
+                                                                  pic_param->pic_fields.bits.entropy_coding_mode_flag,
+                                                                  slice_param->slice_data_bit_offset);
+        dri_bo_unmap(decode_state->slice_datas[slice_index]->bo);

         if (slice_param->slice_type == SLICE_TYPE_I ||
             slice_param->slice_type == SLICE_TYPE_SI)
@@ -693,7 +726,8 @@
 ironlake_avc_bsd_object(VADriverContextP ctx,
                         struct decode_state *decode_state,
                         VAPictureParameterBufferH264 *pic_param,
-                        VASliceParameterBufferH264 *slice_param)
+                        VASliceParameterBufferH264 *slice_param,
+                        int slice_index)
 {
     int width_in_mbs = pic_param->picture_width_in_mbs_minus1 + 1;
     int height_in_mbs = pic_param->picture_height_in_mbs_minus1 + 1; /* frame height */
@@ -711,6 +745,8 @@
         int weighted_pred_idc = 0;
         int first_mb_in_slice;
         int slice_type;
+        uint8_t *slice_data = NULL;
+
         encrypted = 0; /* FIXME: which flag in VAAPI is used for encryption? */

         if (encrypted) {
@@ -718,10 +754,12 @@
         } else
             counter_value = 0;

-        slice_data_bit_offset = slice_param->slice_data_bit_offset;
-
-        if (pic_param->pic_fields.bits.entropy_coding_mode_flag == ENTROPY_CABAC)
-            slice_data_bit_offset = ALIGN(slice_data_bit_offset, 0x8);
+        dri_bo_map(decode_state->slice_datas[slice_index]->bo, 0);
+        slice_data = (uint8_t *)(decode_state->slice_datas[slice_index]->bo->virtual + slice_param->slice_data_offset);
+        slice_data_bit_offset = i965_avc_bsd_get_slice_bit_offset(slice_data,
+                                                                  pic_param->pic_fields.bits.entropy_coding_mode_flag,
+                                                                  slice_param->slice_data_bit_offset);
+        dri_bo_unmap(decode_state->slice_datas[slice_index]->bo);

         if (slice_param->slice_type == SLICE_TYPE_I ||
             slice_param->slice_type == SLICE_TYPE_SI)
@@ -833,14 +871,15 @@
 i965_avc_bsd_object(VADriverContextP ctx,
                     struct decode_state *decode_state,
                     VAPictureParameterBufferH264 *pic_param,
-                    VASliceParameterBufferH264 *slice_param)
+                    VASliceParameterBufferH264 *slice_param,
+                    int slice_index)
 {
     struct i965_driver_data *i965 = i965_driver_data(ctx);

     if (IS_IRONLAKE(i965->intel.device_id))
-        ironlake_avc_bsd_object(ctx, decode_state, pic_param, slice_param);
+        ironlake_avc_bsd_object(ctx, decode_state, pic_param, slice_param, slice_index);
     else
-        g4x_avc_bsd_object(ctx, decode_state, pic_param, slice_param);
+        g4x_avc_bsd_object(ctx, decode_state, pic_param, slice_param, slice_index);
 }

 static void
@@ -848,7 +887,7 @@
                            struct decode_state *decode_state,
                            VAPictureParameterBufferH264 *pic_param)
 {
-    i965_avc_bsd_object(ctx, decode_state, pic_param, NULL);
+    i965_avc_bsd_object(ctx, decode_state, pic_param, NULL, 0);
 }

 static void
@@ -1040,7 +1079,7 @@

             i965_avc_bsd_slice_state(ctx, pic_param, slice_param);
             i965_avc_bsd_buf_base_state(ctx, pic_param, slice_param);
-            i965_avc_bsd_object(ctx, decode_state, pic_param, slice_param);
+            i965_avc_bsd_object(ctx, decode_state, pic_param, slice_param, j);
             slice_param++;
         }
     }


fixed dev::internal::fast_delegate

fixed dev::internal::fast_delegate

--- native/events.h
+++ native/events.h
@@ -46,16 +46,15 @@

     namespace internal
     {
-        // TODO: member function related features are not working properly.
         template<class R=fastdelegate::detail::DefaultVoid, class ...P>
         class fast_delegate_base {
         private:
-            typedef typename fastdelegate::detail::DefaultVoidToVoid<R>::type DesiredRetType;
-            typedef DesiredRetType (*StaticFunctionPtr)(P...);
-            typedef R (*UnvoidStaticFunctionPtr)(P...);
-            typedef R (fastdelegate::detail::GenericClass::*GenericMemFn)(P...);
-            typedef fastdelegate::detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
-            ClosureType m_Closure;
+            typedef typename fastdelegate::detail::DefaultVoidToVoid<R>::type desired_ret_t;
+            typedef desired_ret_t (*static_func_ptr)(P...);
+            typedef R (*unvoid_static_func_ptr)(P...);
+            typedef R (fastdelegate::detail::GenericClass::*generic_mem_fn)(P...);
+            typedef fastdelegate::detail::ClosurePtr<generic_mem_fn, static_func_ptr, unvoid_static_func_ptr> closure_t;
+            closure_t closure_;
         public:
             // Typedefs to aid generic programming
             typedef fast_delegate_base type;
@@ -65,111 +64,114 @@

             fast_delegate_base(const fast_delegate_base &x)
             {
-                m_Closure.CopyFrom(this, x.m_Closure);
+                closure_.CopyFrom(this, x.closure_);
             }

             void operator = (const fast_delegate_base &x)
             {
-                m_Closure.CopyFrom(this, x.m_Closure);
+                closure_.CopyFrom(this, x.closure_);
             }
             bool operator ==(const fast_delegate_base &x) const
             {
-                return m_Closure.IsEqual(x.m_Closure);
+                return closure_.IsEqual(x.closure_);
             }
             bool operator !=(const fast_delegate_base &x) const
             {
-                return !m_Closure.IsEqual(x.m_Closure);
+                return !closure_.IsEqual(x.closure_);
             }
             bool operator <(const fast_delegate_base &x) const
             {
-                return m_Closure.IsLess(x.m_Closure);
+                return closure_.IsLess(x.closure_);
             }
             bool operator >(const fast_delegate_base &x) const
             {
-                return x.m_Closure.IsLess(m_Closure);
+                return x.closure_.IsLess(closure_);
             }

             // Binding to non-const member functions
             template<class X, class Y>
-            fast_delegate_base(Y *pthis, DesiredRetType (X::* function_to_bind)(P&& ... args) )
-            {
-                m_Closure.bindmemfunc(fastdelegate::detail::implicit_cast<X*>(pthis), function_to_bind);
-            }
-
-            template<class X, class Y>
-            inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(P&& ... args))
-            {
-                m_Closure.bindmemfunc(fastdelegate::detail::implicit_cast<X*>(pthis), function_to_bind);
+            fast_delegate_base(Y *pthis, desired_ret_t (X::* function_to_bind)(P...) )
+            {
+                closure_.bindmemfunc(fastdelegate::detail::implicit_cast<X*>(pthis), function_to_bind);
+            }
+
+            template<class X, class Y>
+            inline void bind(Y *pthis, desired_ret_t (X::* function_to_bind)(P...))
+            {
+                closure_.bindmemfunc(fastdelegate::detail::implicit_cast<X*>(pthis), function_to_bind);
             }

             // Binding to const member functions.
             template<class X, class Y>
-            fast_delegate_base(const Y *pthis, DesiredRetType (X::* function_to_bind)(P&& ... args) const)
-            {
-                m_Closure.bindconstmemfunc(fastdelegate::detail::implicit_cast<const X*>(pthis), function_to_bind);
-            }
-
-            template<class X, class Y>
-            inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(P&& ... args) const)
-            {
-                m_Closure.bindconstmemfunc(fastdelegate::detail::implicit_cast<const X *>(pthis), function_to_bind);
+            fast_delegate_base(const Y *pthis, desired_ret_t (X::* function_to_bind)(P...) const)
+            {
+                closure_.bindconstmemfunc(fastdelegate::detail::implicit_cast<const X*>(pthis), function_to_bind);
+            }
+
+            template<class X, class Y>
+            inline void bind(const Y *pthis, desired_ret_t (X::* function_to_bind)(P...) const)
+            {
+                closure_.bindconstmemfunc(fastdelegate::detail::implicit_cast<const X *>(pthis), function_to_bind);
             }

             // Static functions. We convert them into a member function call.
             // This constructor also provides implicit conversion
-            fast_delegate_base(DesiredRetType (*function_to_bind)(P&& ... args) )
+            fast_delegate_base(desired_ret_t (*function_to_bind)(P...) )
             {
                 bind(function_to_bind);
             }

             // for efficiency, prevent creation of a temporary
-            void operator = (DesiredRetType (*function_to_bind)(P&& ... args) )
+            void operator = (desired_ret_t (*function_to_bind)(P...) )
             {
                 bind(function_to_bind);
             }

-            inline void bind(DesiredRetType (*function_to_bind)(P&& ... args))
-            {
-                m_Closure.bindstaticfunc(this, &fast_delegate_base::InvokeStaticFunction, function_to_bind);
+            inline void bind(desired_ret_t (*function_to_bind)(P...))
+            {
+                closure_.bindstaticfunc(this, &fast_delegate_base::invoke_static_func<P...>, function_to_bind);
             }

             // Invoke the delegate
-            R operator()(P&& ... args) const
-            {
-                return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(std::forward<P>(args)...);
+            template<typename ...A>
+            R operator()(A&&... args) const
+            {
+                return (closure_.GetClosureThis()->*(closure_.GetClosureMemPtr()))(std::forward<A>(args)...);
             }
             // Implicit conversion to "bool" using the safe_bool idiom

         private:
-            typedef struct SafeBoolStruct
+            typedef struct safe_bool_struct
             {
                 int a_data_pointer_to_this_is_0_on_buggy_compilers;
-                StaticFunctionPtr m_nonzero;
-            } UselessTypedef;
-            typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
-        public:
-            operator unspecified_bool_type() const { return empty()? 0: &SafeBoolStruct::m_nonzero; }
+                static_func_ptr m_nonzero;
+            } useless_typedef;
+            typedef static_func_ptr safe_bool_struct::*unspecified_bool_type;
+        public:
+            operator unspecified_bool_type() const { return empty()? 0: &safe_bool_struct::m_nonzero; }
             // necessary to allow ==0 to work despite the safe_bool idiom
-            inline bool operator==(StaticFunctionPtr funcptr) { return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
-            inline bool operator!=(StaticFunctionPtr funcptr) { return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
+            inline bool operator==(static_func_ptr funcptr) { return closure_.IsEqualToStaticFuncPtr(funcptr); }
+            inline bool operator!=(static_func_ptr funcptr) { return !closure_.IsEqualToStaticFuncPtr(funcptr); }
             // Is it bound to anything?
-            inline bool operator ! () const { return !m_Closure; }
-            inline bool empty() const { return !m_Closure; }
-            void clear() { m_Closure.clear();}
+            inline bool operator ! () const { return !closure_; }
+            inline bool empty() const { return !closure_; }
+            void clear() { closure_.clear();}
             // Conversion to and from the DelegateMemento storage class
-            const fastdelegate::DelegateMemento & GetMemento() { return m_Closure; }
-            void SetMemento(const fastdelegate::DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
+            const fastdelegate::DelegateMemento & GetMemento() { return closure_; }
+            void SetMemento(const fastdelegate::DelegateMemento &any) { closure_.CopyFrom(this, any); }

         private:
             // Invoker for static functions
-            R InvokeStaticFunction(P&& ... args) const
-            {
-                return (*(m_Closure.GetStaticFunction()))(std::forward<P>(args)...);
+            template<typename ...A>
+            R invoke_static_func(A&&... args) const
+            {
+                return (*(closure_.GetStaticFunction()))(std::forward<A>(args)...);
             }
         };

         // fast_delegate<> is similar to std::function, but it has comparison operators.
-        template <typename Signature> class fast_delegate;
+        template<typename _Signature>
+        class fast_delegate;

         template<typename R, typename ...P>
         class fast_delegate<R(P...)> : public fast_delegate_base<R, P...>
@@ -180,16 +182,16 @@
             fast_delegate() : BaseType() { }

             template<class X, class Y>
-            fast_delegate(Y * pthis, R (X::* function_to_bind)(P&& ... p))
+            fast_delegate(Y * pthis, R (X::* function_to_bind)(P...))
                 : BaseType(pthis, function_to_bind)
             { }

             template<class X, class Y>
-            fast_delegate(const Y *pthis, R (X::* function_to_bind)(P&& ... p) const)
+            fast_delegate(const Y *pthis, R (X::* function_to_bind)(P...) const)
                 : BaseType(pthis, function_to_bind)
             { }

-            fast_delegate(R (*function_to_bind)(P&& ... p))
+            fast_delegate(R (*function_to_bind)(P...))
                 : BaseType(function_to_bind)
             { }


Added comments about ThermoPhase ownership

--- Cantera/src/kinetics/Kinetics.h
+++ Cantera/src/kinetics/Kinetics.h
@@ -899,9 +899,10 @@
 	 */
         std::vector<vector_int> m_products;

-	/**
-	 * m_thermo is a vector of pointers to ThermoPhase
-	 * objects. For homogeneous kinetics applications, this vector
+	//! m_thermo is a vector of pointers to ThermoPhase
+	//! objects.
+        /*!
+         * For homogeneous kinetics applications, this vector
 	 * will only have one entry. For interfacial reactions, this
 	 * vector will consist of multiple entries; some of them will
 	 * be surface phases, and the other ones will be bulk phases.
@@ -909,6 +910,10 @@
 	 * in which the species comprising each phase are listed in
 	 * the source term vector, originating from the reaction
 	 * mechanism.
+         *
+         * Note that this kinetics object doesn't own these ThermoPhase
+         * objects and is not responsible for creating or deleting
+         * them.
 	 */
         std::vector<thermo_t*> m_thermo;


encode: now works for binary (invalid utf8) input

--- codec.c
+++ codec.c
@@ -52,9 +52,10 @@
   PyObject *result = NULL;

   /* Make sure we can handle unicode string inputs.
-     The encoded result will always be a plain ascii string. */
+     The encoded result will always be a plain ascii string.
+     FIXME not true -- eg what if safe set has 0xff */

-  if (!PyArg_ParseTuple(args, "es#:encode", "utf8", &in, &inlen))
+  if (!PyArg_ParseTuple(args, "et#:encode", "utf8", &in, &inlen))
     goto done;

   char* out = NULL;


regen

regen

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@24973 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- utils/typedump/typedump.c
+++ utils/typedump/typedump.c
@@ -760,8 +760,6 @@
 	PRVAL(SLC_OPST_SETXATTR);
 	PRVAL(SLC_OPST_SLC_FCMH_CTOR);
 	PRVAL(SLC_OPST_SLC_FCMH_DTOR);
-	PRVAL(SLC_OPST_SRMT_WRITE);
-	PRVAL(SLC_OPST_SRMT_WRITE_CALLBACK);
 	PRVAL(SLC_OPST_STATFS);
 	PRVAL(SLC_OPST_SYMLINK);
 	PRVAL(SLC_OPST_TRUNCATE_FULL);
@@ -769,8 +767,10 @@
 	PRVAL(SLC_OPST_UNLINK);
 	PRVAL(SLC_OPST_VERSION);
 	PRVAL(SLC_OPST_WRITE);
+	PRVAL(SLC_OPST_WRITE_CALLBACK);
 	PRVAL(SLC_OPST_WRITE_COALESCE);
 	PRVAL(SLC_OPST_WRITE_COALESCE_MAX);
+	PRVAL(SLC_OPST_WRITE_RPC);
 	PRVAL(SLITHRT_ASYNC_IO);
 	PRVAL(SLITHRT_BMAPRLS);
 	PRVAL(SLITHRT_BREAP);


regen

regen

--- utils/typedump/typedump.c
+++ utils/typedump/typedump.c
@@ -32,6 +32,55 @@
 #include "pfl/ctl.h"

 /* start includes */
+#include "authbuf.h"
+#include "bmap.h"
+#include "cache_params.h"
+#include "creds.h"
+#include "ctl.h"
+#include "ctlcli.h"
+#include "ctlsvr.h"
+#include "fid.h"
+#include "fidcache.h"
+#include "mkfn.h"
+#include "pathnames.h"
+#include "slashrpc.h"
+#include "slconfig.h"
+#include "slconn.h"
+#include "slerr.h"
+#include "slsubsys.h"
+#include "sltypes.h"
+#include "slutil.h"
+#include "mount_slash/bmap_cli.h"
+#include "mount_slash/ctl_cli.h"
+#include "mount_slash/ctlsvr_cli.h"
+#include "mount_slash/dircache.h"
+#include "mount_slash/fidc_cli.h"
+#include "mount_slash/mount_slash.h"
+#include "mount_slash/pgcache.h"
+#include "mount_slash/rpc_cli.h"
+#include "mount_slash/subsys_cli.h"
+#include "slashd/bmap_mds.h"
+#include "slashd/ctl_mds.h"
+#include "slashd/fidc_mds.h"
+#include "slashd/inode.h"
+#include "slashd/journal_mds.h"
+#include "slashd/mdsio.h"
+#include "slashd/mdslog.h"
+#include "slashd/namespace.h"
+#include "slashd/repl_mds.h"
+#include "slashd/rpc_mds.h"
+#include "slashd/slashd.h"
+#include "slashd/subsys_mds.h"
+#include "slashd/up_sched_res.h"
+#include "sliod/bmap_iod.h"
+#include "sliod/ctl_iod.h"
+#include "sliod/fidc_iod.h"
+#include "sliod/repl_iod.h"
+#include "sliod/rpc_iod.h"
+#include "sliod/slab.h"
+#include "sliod/sliod.h"
+#include "sliod/slvr.h"
+#include "sliod/subsys_iod.h"
 /* end includes */

 struct bmap_ondisk bmapod;
@@ -90,12 +139,814 @@
 #define PRVALX(val)	pr(#val, (unsigned long)(val), 1)

 	/* start structs */
+	printf("structures:\n");
+	PRTYPE(mdsio_fid_t);
+	PRTYPE(mio_fid_t);
+	PRTYPE(sl_bmapgen_t);
+	PRTYPE(sl_bmapno_t);
+	PRTYPE(sl_ios_id_t);
+	PRTYPE(sl_siteid_t);
+	PRTYPE(slfgen_t);
+	PRTYPE(slfid_t);
+	PRTYPE(struct batchrq);
+	PRTYPE(struct bcrcupd);
+	PRTYPE(struct bmap);
+	PRTYPE(struct bmap_cli_info);
+	PRTYPE(struct bmap_core_state);
+	PRTYPE(struct bmap_extra_state);
+	PRTYPE(struct bmap_iod_info);
+	PRTYPE(struct bmap_iod_minseq);
+	PRTYPE(struct bmap_iod_rls);
+	PRTYPE(struct bmap_ios_assign);
+	PRTYPE(struct bmap_mds_info);
+	PRTYPE(struct bmap_mds_lease);
+	PRTYPE(struct bmap_ondisk);
+	PRTYPE(struct bmap_ops);
+	PRTYPE(struct bmap_pagecache);
+	PRTYPE(struct bmap_pagecache_entry);
+	PRTYPE(struct bmap_timeo_table);
+	PRTYPE(struct bmpc_ioreq);
+	PRTYPE(struct bmpc_write_coalescer);
+	PRTYPE(struct bw_dir);
+	PRTYPE(struct dircache_ent);
+	PRTYPE(struct dircache_ent_query);
+	PRTYPE(struct dircache_expire);
+	PRTYPE(struct dircache_page);
+	PRTYPE(struct fcmh_cli_info);
+	PRTYPE(struct fcmh_cli_info_dir);
+	PRTYPE(struct fcmh_cli_info_file);
+	PRTYPE(struct fcmh_iod_info);
+	PRTYPE(struct fcmh_mds_info);
+	PRTYPE(struct fidc_membh);
+	PRTYPE(struct gid_mapping);
+	PRTYPE(struct lnetif_pair);
+	PRTYPE(struct mdsio_ops);
+	PRTYPE(struct mio_fh);
+	PRTYPE(struct mio_rootnames);
+	PRTYPE(struct msattrflush_thread);
+	PRTYPE(struct msbrelease_thread);
+	PRTYPE(struct msbwatch_thread);
+	PRTYPE(struct msctl_replstq);
+	PRTYPE(struct msctlmsg_biorq);
+	PRTYPE(struct msctlmsg_bmapreplpol);
+	PRTYPE(struct msctlmsg_bmpce);
+	PRTYPE(struct msctlmsg_fattr);
+	PRTYPE(struct msctlmsg_replrq);
+	PRTYPE(struct msctlmsg_replst);
+	PRTYPE(struct msctlmsg_replst_slave);
+	PRTYPE(struct msflush_thread);
+	PRTYPE(struct msfs_thread);
+	PRTYPE(struct msl_fhent);
+	PRTYPE(struct msl_fsrqinfo);
+	PRTYPE(struct msrci_thread);
+	PRTYPE(struct msrcm_thread);
+	PRTYPE(struct msreadahead_thread);
+	PRTYPE(struct readaheadrq);
+	PRTYPE(struct resm_cli_info);
+	PRTYPE(struct resm_iod_info);
+	PRTYPE(struct resm_mds_info);
+	PRTYPE(struct resprof_cli_info);
+	PRTYPE(struct resprof_mds_info);
+	PRTYPE(struct rpmi_ios);
+	PRTYPE(struct rpmi_mds);
+	PRTYPE(struct site_mds_info);
+	PRTYPE(struct site_progress);
+	PRTYPE(struct sl_buffer);
+	PRTYPE(struct sl_config);
+	PRTYPE(struct sl_expcli_ops);
+	PRTYPE(struct sl_fcmh_ops);
+	PRTYPE(struct sl_fidgen);
+	PRTYPE(struct sl_ino_compat);
+	PRTYPE(struct sl_lnetrt);
+	PRTYPE(struct sl_mds_crc_log);
+	PRTYPE(struct sl_resm);
+	PRTYPE(struct sl_resm_nid);
+	PRTYPE(struct sl_resource);
+	PRTYPE(struct sl_site);
+	PRTYPE(struct slash_creds);
+	PRTYPE(struct slc_async_req);
+	PRTYPE(struct slc_wkdata_dircache);
+	PRTYPE(struct slc_wkdata_readdir);
+	PRTYPE(struct slcfg_local);
+	PRTYPE(struct slconn_params);
+	PRTYPE(struct slconn_thread);
+	PRTYPE(struct slctl_res_field);
+	PRTYPE(struct slctlmsg_bmap);
+	PRTYPE(struct slctlmsg_conn);
+	PRTYPE(struct slctlmsg_fcmh);
+	PRTYPE(struct sli_aiocb_reply);
+	PRTYPE(struct sli_batch_reply);
+	PRTYPE(struct sli_exp_cli);
+	PRTYPE(struct sli_iocb);
+	PRTYPE(struct sli_readaheadrq);
+	PRTYPE(struct sli_repl_workrq);
+	PRTYPE(struct slictlmsg_fileop);
+	PRTYPE(struct slictlmsg_replwkst);
+	PRTYPE(struct sliric_thread);
+	PRTYPE(struct slirii_thread);
+	PRTYPE(struct slirim_thread);
+	PRTYPE(struct slm_batchscratch_repl);
+	PRTYPE(struct slm_exp_cli);
+	PRTYPE(struct slm_ino_od);
+	PRTYPE(struct slm_inoh);
+	PRTYPE(struct slm_inox_od);
+	PRTYPE(struct slm_nsstats);
+	PRTYPE(struct slm_progress);
+	PRTYPE(struct slm_readdir_ra_past);
+	PRTYPE(struct slm_replst_workreq);
+	PRTYPE(struct slm_sth);
+	PRTYPE(struct slm_update_data);
+	PRTYPE(struct slm_update_generic);
+	PRTYPE(struct slm_wkdata_batchrq_cb);
+	PRTYPE(struct slm_wkdata_ptrunc);
+	PRTYPE(struct slm_wkdata_readdir);
+	PRTYPE(struct slm_wkdata_rmdir_ino);
+	PRTYPE(struct slm_wkdata_upsch_cb);
+	PRTYPE(struct slm_wkdata_upsch_purge);
+	PRTYPE(struct slm_wkdata_upschq);
+	PRTYPE(struct slm_wkdata_wr_brepl);
+	PRTYPE(struct slmctl_thread);
+	PRTYPE(struct slmctlmsg_bml);
+	PRTYPE(struct slmctlmsg_replqueued);
+	PRTYPE(struct slmctlmsg_statfs);
+	PRTYPE(struct slmctlmsg_upsch_query);
+	PRTYPE(struct slmdbwk_thread);
+	PRTYPE(struct slmds_jent_assign_rep);
+	PRTYPE(struct slmds_jent_bmap_assign);
+	PRTYPE(struct slmds_jent_bmap_crc);
+	PRTYPE(struct slmds_jent_bmap_repls);
+	PRTYPE(struct slmds_jent_bmapseq);
+	PRTYPE(struct slmds_jent_ino_repls);
+	PRTYPE(struct slmds_jent_namespace);
+	PRTYPE(struct slmrcm_thread);
+	PRTYPE(struct slmrmc_thread);
+	PRTYPE(struct slmrmi_thread);
+	PRTYPE(struct slmrmm_thread);
+	PRTYPE(struct slmthr_dbh);
+	PRTYPE(struct slmupsch_thread);
+	PRTYPE(struct slrpc_cservice);
+	PRTYPE(struct slrpc_ops);
+	PRTYPE(struct slvr);
+	PRTYPE(struct srm_batch_req);
+	PRTYPE(struct srm_bmap_chwrmode_rep);
+	PRTYPE(struct srm_bmap_chwrmode_req);
+	PRTYPE(struct srm_bmap_crcup);
+	PRTYPE(struct srm_bmap_crcwrt_rep);
+	PRTYPE(struct srm_bmap_crcwrt_req);
+	PRTYPE(struct srm_bmap_dio_req);
+	PRTYPE(struct srm_bmap_iod_get);
+	PRTYPE(struct srm_bmap_ptrunc_req);
+	PRTYPE(struct srm_bmap_release_rep);
+	PRTYPE(struct srm_bmap_release_req);
+	PRTYPE(struct srm_bmap_wake_req);
+	PRTYPE(struct srm_connect_rep);
+	PRTYPE(struct srm_connect_req);
+	PRTYPE(struct srm_create_rep);
+	PRTYPE(struct srm_create_req);
+	PRTYPE(struct srm_ctl_req);
+	PRTYPE(struct srm_forward_rep);
+	PRTYPE(struct srm_forward_req);
+	PRTYPE(struct srm_generic_rep);
+	PRTYPE(struct srm_get_inode_rep);
+	PRTYPE(struct srm_get_inode_req);
+	PRTYPE(struct srm_getattr2_rep);
+	PRTYPE(struct srm_getattr_rep);
+	PRTYPE(struct srm_getattr_req);
+	PRTYPE(struct srm_getbmap_full_rep);
+	PRTYPE(struct srm_getbmap_full_req);
+	PRTYPE(struct srm_getbmapminseq_rep);
+	PRTYPE(struct srm_getbmapminseq_req);
+	PRTYPE(struct srm_getxattr_rep);
+	PRTYPE(struct srm_getxattr_req);
+	PRTYPE(struct srm_import_rep);
+	PRTYPE(struct srm_import_req);
+	PRTYPE(struct srm_io_rep);
+	PRTYPE(struct srm_io_req);
+	PRTYPE(struct srm_leasebmap_rep);
+	PRTYPE(struct srm_leasebmap_req);
+	PRTYPE(struct srm_leasebmapext_rep);
+	PRTYPE(struct srm_leasebmapext_req);
+	PRTYPE(struct srm_link_req);
+	PRTYPE(struct srm_listxattr_rep);
+	PRTYPE(struct srm_listxattr_req);
+	PRTYPE(struct srm_lookup_req);
+	PRTYPE(struct srm_mkdir_req);
+	PRTYPE(struct srm_mknod_req);
+	PRTYPE(struct srm_ping_req);
+	PRTYPE(struct srm_readdir_ra_req);
+	PRTYPE(struct srm_readdir_rep);
+	PRTYPE(struct srm_readdir_req);
+	PRTYPE(struct srm_readlink_rep);
+	PRTYPE(struct srm_readlink_req);
+	PRTYPE(struct srm_reassignbmap_req);
+	PRTYPE(struct srm_reclaim_rep);
+	PRTYPE(struct srm_reclaim_req);
+	PRTYPE(struct srm_removexattr_rep);
+	PRTYPE(struct srm_removexattr_req);
+	PRTYPE(struct srm_rename_rep);
+	PRTYPE(struct srm_rename_req);
+	PRTYPE(struct srm_repl_read_req);
+	PRTYPE(struct srm_replrq_req);
+	PRTYPE(struct srm_replst_master_req);
+	PRTYPE(struct srm_replst_slave_req);
+	PRTYPE(struct srm_set_bmapreplpol_req);
+	PRTYPE(struct srm_set_fattr_req);
+	PRTYPE(struct srm_setattr_req);
+	PRTYPE(struct srm_setxattr_rep);
+	PRTYPE(struct srm_setxattr_req);
+	PRTYPE(struct srm_statfs_rep);
+	PRTYPE(struct srm_statfs_req);
+	PRTYPE(struct srm_symlink_req);
+	PRTYPE(struct srm_unlink_rep);
+	PRTYPE(struct srm_unlink_req);
+	PRTYPE(struct srm_update_rep);
+	PRTYPE(struct srm_update_req);
+	PRTYPE(struct srt_authbuf_footer);
+	PRTYPE(struct srt_authbuf_secret);
+	PRTYPE(struct srt_bmap_crcwire);
+	PRTYPE(struct srt_bmapdesc);
+	PRTYPE(struct srt_bmapminseq);
+	PRTYPE(struct srt_bwqueued);
+	PRTYPE(struct srt_creds);
+	PRTYPE(struct srt_ctlsetopt);
+	PRTYPE(struct srt_inode);
+	PRTYPE(struct srt_preclaim_repent);
+	PRTYPE(struct srt_preclaim_reqent);
+	PRTYPE(struct srt_readdir_ent);
+	PRTYPE(struct srt_reclaim_entry);
+	PRTYPE(struct srt_replst_bhdr);
+	PRTYPE(struct srt_replwk_repent);
+	PRTYPE(struct srt_replwk_reqent);
+	PRTYPE(struct srt_stat);
+	PRTYPE(struct srt_statfs);
+	PRTYPE(struct srt_update_entry);
+	PRTYPE(struct uid_mapping);
 	/* end structs */

 	/* start constants */
+	printf("\nvalues:\n");
+	PRVAL(AUTHBUF_ALGLEN);
+	PRVAL(AUTHBUF_KEYSIZE);
+	PRVAL(BATCHF_RQINFL);
+	PRVAL(BATCHF_WAITREPLY);
+	PRVAL(BCR_BATCH_AGE);
+	PRVAL(BIAF_DIO);
+	PRVAL(BIM_MINAGE);
+	PRVAL(BIM_RETRIEVE_SEQ);
+	PRVAL(BIORQ_DESTROY);
+	PRVAL(BIORQ_DIO);
+	PRVAL(BIORQ_EXPIRE);
+	PRVAL(BIORQ_FLUSHRDY);
+	PRVAL(BIORQ_FREEBUF);
+	PRVAL(BIORQ_ONTREE);
+	PRVAL(BIORQ_READ);
+	PRVAL(BIORQ_READAHEAD);
+	PRVAL(BIORQ_WAIT);
+	PRVAL(BIORQ_WRITE);
+	PRVAL(BMAPFLSH_EXPIRE);
+	PRVAL(BMAPFLSH_REAP);
+	PRVAL(BMAPFLSH_RPCDONE);
+	PRVAL(BMAPFLSH_RPCWAIT);
+	PRVAL(BMAPFLSH_TIMEOA);
+	PRVAL(BMAPFLSH_TRUNCATE);
+	PRVAL(BMAPF_BUSY);
+	PRVAL(BMAPF_DIO);
+	PRVAL(BMAPF_DIOCB);
+	PRVAL(BMAPF_INIT);
+	PRVAL(BMAPF_MODECHNG);
+	PRVAL(BMAPF_RD);
+	PRVAL(BMAPF_TOFREE);
+	PRVAL(BMAPF_WAITERS);
+	PRVAL(BMAPF_WR);
+	PRVAL(BMAPGETF_ASYNC);
+	PRVAL(BMAPGETF_CREATE);
+	PRVAL(BMAPGETF_NOAUTOINST);
+	PRVAL(BMAPGETF_NODISKREAD);
+	PRVAL(BMAPGETF_NORETRIEVE);
+	PRVAL(BMAPGETF_VALID);
+	PRVAL(BMAP_CACHE_MAX);
+	PRVAL(BMAP_CLI_EXTREQSECS);
+	PRVAL(BMAP_CLI_MAX_LEASE);
+	PRVAL(BMAP_CLI_TIMEO_INC);
+	PRVAL(BMAP_SEQLOG_FACTOR);
+	PRVAL(BMAP_SLVR_CRC);
+	PRVAL(BMAP_SLVR_CRCABSENT);
+	PRVAL(BMAP_SLVR_DATA);
+	PRVAL(BMAP_TIMEO_MAX);
+	PRVAL(BML_ASSFAIL);
+	PRVAL(BML_BMI);
+	PRVAL(BML_CHAIN);
+	PRVAL(BML_DIO);
+	PRVAL(BML_DIOCB);
+	PRVAL(BML_FREEING);
+	PRVAL(BML_READ);
+	PRVAL(BML_RECOVER);
+	PRVAL(BML_RECOVERFAIL);
+	PRVAL(BML_TIMEOQ);
+	PRVAL(BML_WRITE);
+	PRVAL(BMPCEF_ACCESSED);
+	PRVAL(BMPCEF_AIOWAIT);
+	PRVAL(BMPCEF_DATARDY);
+	PRVAL(BMPCEF_DISCARD);
+	PRVAL(BMPCEF_EIO);
+	PRVAL(BMPCEF_FAULTING);
+	PRVAL(BMPCEF_FREED);
+	PRVAL(BMPCEF_IDLE);
+	PRVAL(BMPCEF_PINNED);
+	PRVAL(BMPCEF_READAHEAD);
+	PRVAL(BMPCEF_READALC);
+	PRVAL(BMPCEF_REAPED);
+	PRVAL(BMPCEF_TOFREE);
+	PRVAL(BPHXC);
+	PRVAL(BREPLST_GARBAGE);
+	PRVAL(BREPLST_GARBAGE_SCHED);
+	PRVAL(BREPLST_INVALID);
+	PRVAL(BREPLST_REPL_QUEUED);
+	PRVAL(BREPLST_REPL_SCHED);
+	PRVAL(BREPLST_TRUNCPNDG);
+	PRVAL(BREPLST_TRUNCPNDG_SCHED);
+	PRVAL(BREPLST_VALID);
+	PRVAL(BRPOL_ONETIME);
+	PRVAL(BRPOL_PERSIST);
+	PRVAL(BTE_ADD);
+	PRVAL(BTE_DEL);
+	PRVAL(BTE_REATTACH);
+	PRVAL(BW_UNITSZ);
+	PRVAL(CRC_QUEUE_AGE);
+	PRVAL(CSVCF_ABANDON);
+	PRVAL(CSVCF_BUSY);
+	PRVAL(CSVCF_CONNECTED);
+	PRVAL(CSVCF_CONNECTING);
+	PRVAL(CSVCF_LASTFLAG);
+	PRVAL(CSVCF_NONBLOCK);
+	PRVAL(CSVCF_NORECON);
+	PRVAL(CSVCF_PING);
+	PRVAL(CSVCF_WANTFREE);
+	PRVAL(CSVC_PING_INTV);
+	PRVAL(CSVC_RECONNECT_INTV);
+	PRVAL(DIRCACHEPGF_EOF);
+	PRVAL(DIRCACHEPGF_FREEING);
+	PRVAL(DIRCACHEPGF_LOADING);
+	PRVAL(DIRCACHEPGF_READ);
+	PRVAL(DIRCACHEPG_HARD_TIMEO);
+	PRVAL(DIRCACHEPG_SOFT_TIMEO);
+	PRVAL(DIR_LOOKUP_MISSES_INCR);
+	PRVAL(DIR_LOOKUP_MISSES_THRES);
+	PRVAL(FCMH_ATTR_TIMEO);
+	PRVAL(FCMH_BUSY);
+	PRVAL(FCMH_CTOR_FAILED);
+	PRVAL(FCMH_DELETED);
+	PRVAL(FCMH_FREE);
+	PRVAL(FCMH_GETTING_ATTRS);
+	PRVAL(FCMH_HAVE_ATTRS);
+	PRVAL(FCMH_IDLE);
+	PRVAL(FCMH_INITING);
+	PRVAL(FCMH_OPCNT_BMAP);
+	PRVAL(FCMH_OPCNT_DIRCACHE);
+	PRVAL(FCMH_OPCNT_DIRTY_QUEUE);
+	PRVAL(FCMH_OPCNT_LOOKUP_FIDC);
+	PRVAL(FCMH_OPCNT_NEW);
+	PRVAL(FCMH_OPCNT_OPEN);
+	PRVAL(FCMH_OPCNT_READAHEAD);
+	PRVAL(FCMH_OPCNT_READDIR);
+	PRVAL(FCMH_OPCNT_UPSCH);
+	PRVAL(FCMH_OPCNT_WAIT);
+	PRVAL(FCMH_OPCNT_WORKER);
+	PRVAL(FCMH_SETATTRF_CLOBBER);
+	PRVAL(FCMH_SETATTRF_HAVELOCK);
+	PRVAL(FCMH_TOFREE);
+	PRVAL(FCMH_WAITING);
+	PRVAL(FIDC_LOOKUP_CREATE);
+	PRVAL(FIDC_LOOKUP_EXCL);
+	PRVAL(FIDC_LOOKUP_LOAD);
+	PRVAL(FIDC_LOOKUP_NOLOG);
+	PRVAL(FIDC_LOOKUP_NONE);
+	PRVAL(FID_PATH_DEPTH);
+	PRVAL(FID_PATH_START);
+	PRVAL(FSID_LEN);
+	PRVAL(INOF_IOS_AFFINITY);
+	PRVAL(INOH_INO_NEW);
+	PRVAL(INOH_INO_NOTLOADED);
+	PRVAL(INTRES_NAME_MAX);
+	PRVAL(IOSV_LOOKUPF_ADD);
+	PRVAL(IOSV_LOOKUPF_DEL);
+	PRVAL(LNET_NAME_MAX);
+	PRVAL(LPF_NOACCEPTOR);
+	PRVAL(LPF_SKIP);
+	PRVAL(MAPSTIR_THRESH);
+	PRVAL(MAX_BMAPS_REQ);
+	PRVAL(MAX_BMAP_INODE_PAIRS);
+	PRVAL(MAX_BMAP_NCRC_UPDATES);
+	PRVAL(MAX_BMAP_RELEASE);
+	PRVAL(MDSIO_FID_ROOT);
+	PRVAL(MDSIO_OPENCRF_NOLINK);
+	PRVAL(MDSIO_OPENCRF_NOMTIM);
+	PRVAL(MFHF_CLOSING);
+	PRVAL(MFHF_TRACKING_RA);
+	PRVAL(MFHF_TRACKING_WA);
+	PRVAL(MFSRQ_AIOWAIT);
+	PRVAL(MFSRQ_COPIED);
+	PRVAL(MFSRQ_FSREPLIED);
+	PRVAL(MFSRQ_NONE);
+	PRVAL(MFSRQ_READ);
+	PRVAL(MRSLF_EOF);
+	PRVAL(MSCMT_ADDREPLRQ);
+	PRVAL(MSCMT_DELREPLRQ);
+	PRVAL(MSCMT_GETBIORQ);
+	PRVAL(MSCMT_GETBMAP);
+	PRVAL(MSCMT_GETBMPCE);
+	PRVAL(MSCMT_GETCONNS);
+	PRVAL(MSCMT_GETFCMH);
+	PRVAL(MSCMT_GETREPLST);
+	PRVAL(MSCMT_GETREPLST_SLAVE);
+	PRVAL(MSCMT_GET_BMAPREPLPOL);
+	PRVAL(MSCMT_GET_FATTR);
+	PRVAL(MSCMT_SET_BMAPREPLPOL);
+	PRVAL(MSCMT_SET_FATTR);
+	PRVAL(MSL_CBARG_BIORQ);
+	PRVAL(MSL_CBARG_BIORQS);
+	PRVAL(MSL_CBARG_BMAP);
+	PRVAL(MSL_CBARG_BMPC);
+	PRVAL(MSL_CBARG_BMPCE);
+	PRVAL(MSL_CBARG_CSVC);
+	PRVAL(MSL_CBARG_RESM);
+	PRVAL(MSL_READDIR_CBARG_CSVC);
+	PRVAL(MSL_READDIR_CBARG_FCMH);
+	PRVAL(MSL_READDIR_CBARG_PAGE);
+	PRVAL(MS_READAHEAD_MAXPGS);
+	PRVAL(MS_READAHEAD_PIPESZ);
+	PRVAL(NBREPLST);
+	PRVAL(NBRPOL);
+	PRVAL(NPREFIOS);
+	PRVAL(NSLVRCRC_THRS);
+	PRVAL(NSLVR_READAHEAD_THRS);
+	PRVAL(NUM_ATTR_FLUSH_THREADS);
+	PRVAL(NUM_BMAP_FLUSH_THREADS);
+	PRVAL(NUM_READAHEAD_THREADS);
+	PRVAL(REPL_WALKF_MODOTH);
+	PRVAL(REPL_WALKF_SCIRCUIT);
+	PRVAL(RESF_DISABLE_BIA);
+	PRVAL(RESF_PREFIOS);
+	PRVAL(RIC_MAX_SLVRS_PER_IO);
+	PRVAL(RPCIF_AVOID);
+	PRVAL(SIF_DISABLE_ADVLEASE);
+	PRVAL(SIF_DISABLE_GC);
+	PRVAL(SIF_DISABLE_LEASE);
+	PRVAL(SIF_NEED_JRNL_INIT);
+	PRVAL(SIF_NEW_PROG_ENTRY);
+	PRVAL(SIF_PRECLAIM_NOTSUP);
+	PRVAL(SIF_UPSCH_PAGING);
+	PRVAL(SITE_NAME_MAX);
+	PRVAL(SLASH2_IGNORE_CTIME);
+	PRVAL(SLASH2_IGNORE_MTIME);
+	PRVAL(SLASH_BLKS_PER_SLVR);
+	PRVAL(SLASH_BMAP_CRCSIZE);
+	PRVAL(SLASH_BMAP_SIZE);
+	PRVAL(SLASH_CRCS_PER_BMAP);
+	PRVAL(SLASH_FID_CYCLE_BITS);
+	PRVAL(SLASH_FID_CYCLE_SHFT);
+	PRVAL(SLASH_FID_FLAG_BITS);
+	PRVAL(SLASH_FID_FLAG_SHFT);
+	PRVAL(SLASH_FID_INUM_BITS);
+	PRVAL(SLASH_FID_INUM_SHFT);
+	PRVAL(SLASH_FID_MDSID_BITS);
+	PRVAL(SLASH_FID_MDSID_SHFT);
+	PRVAL(SLASH_FSID);
+	PRVAL(SLASH_SLVRS_PER_BMAP);
+	PRVAL(SLASH_SLVR_BLKMASK);
+	PRVAL(SLASH_SLVR_BLKSZ);
+	PRVAL(SLASH_SLVR_SIZE);
+	PRVAL(SLCTL_FCL_ALL);
+	PRVAL(SLCTL_FCL_BUSY);
+	PRVAL(SLCTL_REST_CLI);
+	PRVAL(SLFID_MIN);
+	PRVAL(SLFID_NS);
+	PRVAL(SLFID_ROOT);
+	PRVAL(SLIOD_BMAP_RLS_WAIT_SECS);
+	PRVAL(SLI_AIOCBSF_DIO);
+	PRVAL(SLI_AIOCBSF_NONE);
+	PRVAL(SLI_AIOCBSF_REPL);
+	PRVAL(SLI_CTL_FOPF_RECURSIVE);
+	PRVAL(SLI_CTL_FOPF_SYMBOLIC);
+	PRVAL(SLI_CTL_FOPF_VERBOSE);
+	PRVAL(SLI_CTL_FOPF_XREPL);
+	PRVAL(SLI_RIC_BUFSZ);
+	PRVAL(SLI_RIC_NBUFS);
+	PRVAL(SLI_RIC_NTHREADS);
+	PRVAL(SLI_RIC_REPSZ);
+	PRVAL(SLI_RII_BUFSZ);
+	PRVAL(SLI_RII_NBUFS);
+	PRVAL(SLI_RII_NTHREADS);
+	PRVAL(SLI_RII_REPSZ);
+	PRVAL(SLI_RIM_BUFSZ);
+	PRVAL(SLI_RIM_NBUFS);
+	PRVAL(SLI_RIM_NTHREADS);
+	PRVAL(SLI_RIM_REPSZ);
+	PRVAL(SLJ_MDS_ENTSIZE);
+	PRVAL(SLJ_MDS_READSZ);
+	PRVAL(SLM_NWORKER_THREADS);
+	PRVAL(SLM_RECLAIM_BATCH_NENTS);
+	PRVAL(SLM_RMC_BUFSZ);
+	PRVAL(SLM_RMC_NBUFS);
+	PRVAL(SLM_RMC_NTHREADS);
+	PRVAL(SLM_RMC_REPSZ);
+	PRVAL(SLM_RMI_BUFSZ);
+	PRVAL(SLM_RMI_NBUFS);
+	PRVAL(SLM_RMI_NTHREADS);
+	PRVAL(SLM_RMI_REPSZ);
+	PRVAL(SLM_RMM_BUFSZ);
+	PRVAL(SLM_RMM_NBUFS);
+	PRVAL(SLM_RMM_NTHREADS);
+	PRVAL(SLM_RMM_REPSZ);
+	PRVAL(SLM_UPDATE_BATCH_NENTS);
+	PRVAL(SLRPC_DISCONNF_HIGHLEVEL);
+	PRVAL(SLRPC_DISCONNF_RECON);
+	PRVAL(SLRPC_MSGADJ);
+	PRVAL(SLVRF_ACCESSED);
+	PRVAL(SLVRF_READAHEAD);
+	PRVAL(SLVR_CRCDIRTY);
+	PRVAL(SLVR_DATAERR);
+	PRVAL(SLVR_DATARDY);
+	PRVAL(SLVR_FAULTING);
+	PRVAL(SLVR_FREEING);
+	PRVAL(SLVR_LRU);
+	PRVAL(SLVR_PINNED);
+	PRVAL(SL_BITS_PER_REPLICA);
+	PRVAL(SL_DEF_REPLICAS);
+	PRVAL(SL_DEF_SNAPSHOTS);
+	PRVAL(SL_FATTR_IOS_AFFINITY);
+	PRVAL(SL_FATTR_REPLPOL);
+	PRVAL(SL_MAX_BMAPFLSH_RETRIES);
+	PRVAL(SL_MAX_IOSREASSIGN);
+	PRVAL(SL_MAX_REPLICAS);
+	PRVAL(SL_NAME_MAX);
+	PRVAL(SL_NBITS_REPLST_BHDR);
+	PRVAL(SL_PATH_MAX);
+	PRVAL(SL_RES_BITS);
+	PRVAL(SL_SITE_BITS);
+	PRVAL(SL_TWO_NAME_MAX);
+	PRVAL(SPF_NEED_JRNL_INIT);
+	PRVAL(SRCI_BUFSZ);
+	PRVAL(SRCI_BULK_PORTAL);
+	PRVAL(SRCI_CTL_PORTAL);
+	PRVAL(SRCI_NBUFS);
+	PRVAL(SRCI_NTHREADS);
+	PRVAL(SRCI_REPSZ);
+	PRVAL(SRCI_REP_PORTAL);
+	PRVAL(SRCI_REQ_PORTAL);
+	PRVAL(SRCI_VERSION);
+	PRVAL(SRCM_BUFSZ);
+	PRVAL(SRCM_BULK_PORTAL);
+	PRVAL(SRCM_CTL_PORTAL);
+	PRVAL(SRCM_NBUFS);
+	PRVAL(SRCM_NTHREADS);
+	PRVAL(SRCM_REPSZ);
+	PRVAL(SRCM_REP_PORTAL);
+	PRVAL(SRCM_REQ_PORTAL);
+	PRVAL(SRCM_VERSION);
+	PRVAL(SRIC_BULK_PORTAL);
+	PRVAL(SRIC_CTL_PORTAL);
+	PRVAL(SRIC_REP_PORTAL);
+	PRVAL(SRIC_REQ_PORTAL);
+	PRVAL(SRIC_VERSION);
+	PRVAL(SRII_BULK_PORTAL);
+	PRVAL(SRII_CTL_PORTAL);
+	PRVAL(SRII_REP_PORTAL);
+	PRVAL(SRII_REQ_PORTAL);
+	PRVAL(SRII_VERSION);
+	PRVAL(SRIM_BULK_PORTAL);
+	PRVAL(SRIM_CTL_PORTAL);
+	PRVAL(SRIM_REP_PORTAL);
+	PRVAL(SRIM_REQ_PORTAL);
+	PRVAL(SRIM_VERSION);
+	PRVAL(SRMCTL_OPT_HEALTH);
+	PRVAL(SRMC_BULK_PORTAL);
+	PRVAL(SRMC_CTL_PORTAL);
+	PRVAL(SRMC_REP_PORTAL);
+	PRVAL(SRMC_REQ_PORTAL);
+	PRVAL(SRMC_VERSION);
+	PRVAL(SRMIOP_RD);
+	PRVAL(SRMIOP_WR);
+	PRVAL(SRMI_BULK_PORTAL);
+	PRVAL(SRMI_CTL_PORTAL);
+	PRVAL(SRMI_REP_PORTAL);
+	PRVAL(SRMI_REQ_PORTAL);
+	PRVAL(SRMI_VERSION);
+	PRVAL(SRMM_BULK_PORTAL);
+	PRVAL(SRMM_CTL_PORTAL);
+	PRVAL(SRMM_REP_PORTAL);
+	PRVAL(SRMM_REQ_PORTAL);
+	PRVAL(SRMM_VERSION);
+	PRVAL(SRM_BMAPCRCWRT_PTRUNC);
+	PRVAL(SRM_CTLOP_SETOPT);
+	PRVAL(SRM_IMPORTF_XREPL);
+	PRVAL(SRM_IOF_APPEND);
+	PRVAL(SRM_IOF_BENCH);
+	PRVAL(SRM_IOF_DIO);
+	PRVAL(SRM_LEASEBMAPF_DATA);
+	PRVAL(SRM_LEASEBMAPF_DIO);
+	PRVAL(SRM_LEASEBMAPF_GETINODE);
+	PRVAL(SRM_READDIRF_XATTR);
+	PRVAL(SRM_RENAME_NAMEMAX);
+	PRVAL(SRPCWAITF_DEFER_BULK_AUTHBUF_CHECK);
+	PRVAL(UPDF_BUSY);
+	PRVAL(_BMAPF_SHIFT);
+	PRVAL(_BMAP_SLVR_FLSHFT);
+	PRVAL(_FCMH_FLGSHFT);
+	PRVAL(_SLERR_START);
 	/* end constants */

 	/* start enums */
+	printf("\nenums:\n");
+	PRVAL(BMAP_OPCNT_ASYNC);
+	PRVAL(BMAP_OPCNT_BCRSCHED);
+	PRVAL(BMAP_OPCNT_BIORQ);
+	PRVAL(BMAP_OPCNT_FLUSH);
+	PRVAL(BMAP_OPCNT_LEASE);
+	PRVAL(BMAP_OPCNT_LEASEEXT);
+	PRVAL(BMAP_OPCNT_LOOKUP);
+	PRVAL(BMAP_OPCNT_REAPER);
+	PRVAL(BMAP_OPCNT_REASSIGN);
+	PRVAL(BMAP_OPCNT_REPLWK);
+	PRVAL(BMAP_OPCNT_SLVR);
+	PRVAL(BMAP_OPCNT_TRUNCWAIT);
+	PRVAL(BMAP_OPCNT_UPSCH);
+	PRVAL(BMAP_OPCNT_WORK);
+	PRVAL(MSL_BMLGET_CBARG_BMAP);
+	PRVAL(MSL_BMLGET_CBARG_COMPL);
+	PRVAL(MSL_BMLGET_CBARG_CSVC);
+	PRVAL(MSTHRT_ATTR_FLUSH);
+	PRVAL(MSTHRT_BENCH);
+	PRVAL(MSTHRT_BRELEASE);
+	PRVAL(MSTHRT_BWATCH);
+	PRVAL(MSTHRT_CONN);
+	PRVAL(MSTHRT_CTL);
+	PRVAL(MSTHRT_CTLAC);
+	PRVAL(MSTHRT_EQPOLL);
+	PRVAL(MSTHRT_FLUSH);
+	PRVAL(MSTHRT_FREAP);
+	PRVAL(MSTHRT_FS);
+	PRVAL(MSTHRT_FSMGR);
+	PRVAL(MSTHRT_NBRQ);
+	PRVAL(MSTHRT_OPSTIMER);
+	PRVAL(MSTHRT_RCI);
+	PRVAL(MSTHRT_RCM);
+	PRVAL(MSTHRT_READAHEAD);
+	PRVAL(MSTHRT_USKLNDPL);
+	PRVAL(MSTHRT_WORKER);
+	PRVAL(NAMECACHELOOKUPF_CLOBBER);
+	PRVAL(NAMECACHELOOKUPF_DELETE);
+	PRVAL(NAMECACHELOOKUPF_INSERT);
+	PRVAL(NAMECACHELOOKUPF_PEEK);
+	PRVAL(NAMECACHELOOKUPF_UPDATE);
+	PRVAL(NS_DIR_RECV);
+	PRVAL(NS_DIR_SEND);
+	PRVAL(NS_NDIRS);
+	PRVAL(NS_NOPS);
+	PRVAL(NS_NSUMS);
+	PRVAL(NS_OP_CREATE);
+	PRVAL(NS_OP_LINK);
+	PRVAL(NS_OP_MKDIR);
+	PRVAL(NS_OP_RECLAIM);
+	PRVAL(NS_OP_RENAME);
+	PRVAL(NS_OP_RMDIR);
+	PRVAL(NS_OP_SETATTR);
+	PRVAL(NS_OP_SETSIZE);
+	PRVAL(NS_OP_SYMLINK);
+	PRVAL(NS_OP_UNLINK);
+	PRVAL(NS_SUM_FAIL);
+	PRVAL(NS_SUM_PEND);
+	PRVAL(NS_SUM_SUCC);
+	PRVAL(SLCONNT_CLI);
+	PRVAL(SLCONNT_IOD);
+	PRVAL(SLCONNT_MDS);
+	PRVAL(SLC_FAULT_READAHEAD_CB_EIO);
+	PRVAL(SLC_FAULT_READRPC_OFFLINE);
+	PRVAL(SLC_FAULT_READ_CB_EIO);
+	PRVAL(SLC_FAULT_REQUEST_TIMEOUT);
+	PRVAL(SLITHRT_AIO);
+	PRVAL(SLITHRT_BMAPRLS);
+	PRVAL(SLITHRT_BREAP);
+	PRVAL(SLITHRT_CONN);
+	PRVAL(SLITHRT_CRUD);
+	PRVAL(SLITHRT_CTL);
+	PRVAL(SLITHRT_CTLAC);
+	PRVAL(SLITHRT_FREAP);
+	PRVAL(SLITHRT_HEALTH);
+	PRVAL(SLITHRT_LNETAC);
+	PRVAL(SLITHRT_NBRQ);
+	PRVAL(SLITHRT_OPSTIMER);
+	PRVAL(SLITHRT_READAHEAD);
+	PRVAL(SLITHRT_REPLPND);
+	PRVAL(SLITHRT_RIC);
+	PRVAL(SLITHRT_RII);
+	PRVAL(SLITHRT_RIM);
+	PRVAL(SLITHRT_SLVR_CRC);
+	PRVAL(SLITHRT_STATFS);
+	PRVAL(SLITHRT_USKLNDPL);
+	PRVAL(SLITHRT_WORKER);
+	PRVAL(SLI_FAULT_AIO_FAIL);
+	PRVAL(SLI_FAULT_CRCUP_FAIL);
+	PRVAL(SLI_FAULT_FSIO_READ_FAIL);
+	PRVAL(SLI_REPLWKOP_PTRUNC);
+	PRVAL(SLI_REPLWKOP_REPL);
+	PRVAL(SLMTHRT_BATCHRQ);
+	PRVAL(SLMTHRT_BKDB);
+	PRVAL(SLMTHRT_BMAPTIMEO);
+	PRVAL(SLMTHRT_CONN);
+	PRVAL(SLMTHRT_CTL);
+	PRVAL(SLMTHRT_CTLAC);
+	PRVAL(SLMTHRT_CURSOR);
+	PRVAL(SLMTHRT_DBWORKER);
+	PRVAL(SLMTHRT_FREAP);
+	PRVAL(SLMTHRT_JNAMESPACE);
+	PRVAL(SLMTHRT_JRECLAIM);
+	PRVAL(SLMTHRT_JRNL);
+	PRVAL(SLMTHRT_LNETAC);
+	PRVAL(SLMTHRT_NBRQ);
+	PRVAL(SLMTHRT_OPSTIMER);
+	PRVAL(SLMTHRT_RCM);
+	PRVAL(SLMTHRT_RMC);
+	PRVAL(SLMTHRT_RMI);
+	PRVAL(SLMTHRT_RMM);
+	PRVAL(SLMTHRT_UPSCHED);
+	PRVAL(SLMTHRT_USKLNDPL);
+	PRVAL(SLMTHRT_WORKER);
+	PRVAL(SLMTHRT_ZFS_KSTAT);
+	PRVAL(SLM_FORWARD_CREATE);
+	PRVAL(SLM_FORWARD_MKDIR);
+	PRVAL(SLM_FORWARD_RENAME);
+	PRVAL(SLM_FORWARD_RMDIR);
+	PRVAL(SLM_FORWARD_SETATTR);
+	PRVAL(SLM_FORWARD_SYMLINK);
+	PRVAL(SLM_FORWARD_UNLINK);
+	PRVAL(SLM_OPSTATE_INIT);
+	PRVAL(SLM_OPSTATE_NORMAL);
+	PRVAL(SLM_OPSTATE_REPLAY);
+	PRVAL(SLREST_ARCHIVAL_FS);
+	PRVAL(SLREST_CLUSTER_NOSHARE_LFS);
+	PRVAL(SLREST_MDS);
+	PRVAL(SLREST_NONE);
+	PRVAL(SLREST_PARALLEL_COMPNT);
+	PRVAL(SLREST_PARALLEL_LFS);
+	PRVAL(SLREST_STANDALONE_FS);
+	PRVAL(SL_READ);
+	PRVAL(SL_WRITE);
+	PRVAL(SRMT_BATCH_RP);
+	PRVAL(SRMT_BATCH_RQ);
+	PRVAL(SRMT_BMAPCHWRMODE);
+	PRVAL(SRMT_BMAPCRCWRT);
+	PRVAL(SRMT_BMAPDIO);
+	PRVAL(SRMT_BMAP_PTRUNC);
+	PRVAL(SRMT_BMAP_WAKE);
+	PRVAL(SRMT_CONNECT);
+	PRVAL(SRMT_CREATE);
+	PRVAL(SRMT_CTL);
+	PRVAL(SRMT_EXTENDBMAPLS);
+	PRVAL(SRMT_GETATTR);
+	PRVAL(SRMT_GETBMAP);
+	PRVAL(SRMT_GETBMAPCRCS);
+	PRVAL(SRMT_GETBMAPMINSEQ);
+	PRVAL(SRMT_GETXATTR);
+	PRVAL(SRMT_GET_INODE);
+	PRVAL(SRMT_IMPORT);
+	PRVAL(SRMT_LINK);
+	PRVAL(SRMT_LISTXATTR);
+	PRVAL(SRMT_LOOKUP);
+	PRVAL(SRMT_MKDIR);
+	PRVAL(SRMT_MKNOD);
+	PRVAL(SRMT_NAMESPACE_FORWARD);
+	PRVAL(SRMT_NAMESPACE_UPDATE);
+	PRVAL(SRMT_PING);
+	PRVAL(SRMT_PRECLAIM);
+	PRVAL(SRMT_READ);
+	PRVAL(SRMT_READDIR);
+	PRVAL(SRMT_READLINK);
+	PRVAL(SRMT_REASSIGNBMAPLS);
+	PRVAL(SRMT_RECLAIM);
+	PRVAL(SRMT_RELEASEBMAP);
+	PRVAL(SRMT_REMOVEXATTR);
+	PRVAL(SRMT_RENAME);
+	PRVAL(SRMT_REPL_ADDRQ);
+	PRVAL(SRMT_REPL_DELRQ);
+	PRVAL(SRMT_REPL_GETST);
+	PRVAL(SRMT_REPL_GETST_SLAVE);
+	PRVAL(SRMT_REPL_READ);
+	PRVAL(SRMT_REPL_READAIO);
+	PRVAL(SRMT_REPL_SCHEDWK);
+	PRVAL(SRMT_RMDIR);
+	PRVAL(SRMT_SETATTR);
+	PRVAL(SRMT_SETXATTR);
+	PRVAL(SRMT_SET_BMAPREPLPOL);
+	PRVAL(SRMT_SET_FATTR);
+	PRVAL(SRMT_STATFS);
+	PRVAL(SRMT_SYMLINK);
+	PRVAL(SRMT_UNLINK);
+	PRVAL(SRMT_WRITE);
+	PRVAL(UPDT_BMAP);
+	PRVAL(UPDT_HLDROP);
+	PRVAL(UPDT_PAGEIN);
+	PRVAL(UPDT_PAGEIN_UNIT);
 	/* end enums */

 	PRVAL(SL_REPLICA_NBYTES);


naming fix

naming fix

--- features/FEATURE_BLE/ble/pal/PalSecurityManager.h
+++ features/FEATURE_BLE/ble/pal/PalSecurityManager.h
@@ -100,8 +100,8 @@

 class SecurityManagerEventHandler {
     SecurityManagerEventHandler() : _app_event_handler(NULL) { };
-    virtual void security_setup_initiated(connection_handle_t handle, bool allowBonding,
-                                          bool requireMITM, SecurityManager::SecurityIOCapabilities_t iocaps) {
+    virtual void security_setup_initiated(connection_handle_t handle, bool allow_bonding,
+                                          bool require_mitm, SecurityManager::SecurityIOCapabilities_t iocaps) {
         if (_app_event_handler) {
             _app_event_handler->securitySetupInitiated(handle, allowBonding, requireMITM, iocaps);
         }
@@ -112,7 +112,7 @@
             _app_event_handler->securitySetupCompleted(handle, status);
         }
     }
-    virtual void link_secured(connection_handle_t handle, SecurityManager::SecurityMode_t securityMode) {
+    virtual void link_secured(connection_handle_t handle, SecurityManager::SecurityMode_t security_mode) {
         if (_app_event_handler) {
             _app_event_handler->linkSecured(handle, securityMode);
         }


Opts: std::string opt(index/key) functions

--- testlib.h
+++ testlib.h
@@ -4707,6 +4707,10 @@
     return opt<T>(std::is_integral<T>(), std::is_unsigned<T>(), index);
 }

+std::string opt(int index) {
+    return opt<std::string>(index);
+}
+
 template<typename T>
 T opt(std::false_type, const std::string& key);

@@ -4749,5 +4753,9 @@
 T opt(const std::string key) {
     return opt<T>(std::is_integral<T>(), std::is_unsigned<T>(), key);
 }
-#endif
-#endif
+
+std::string opt(const std::string key) {
+    return opt<std::string>(key);
+}
+#endif
+#endif


This should do it. Seriously

This should do it. Seriously

--- hash_map.h
+++ hash_map.h
@@ -52,7 +52,7 @@
 							{/**/}
 							template<typename UNodePtr, typename UPtr, typename URef>
 								node_iterator(const node_iterator<UNodePtr, UPtr, URef>& rhs)
-								:	m_node(rhs.node()), m_map(const_cast<typename rde::hash_map<TKey, TValue>::node*>(rhs.get_map()))
+								:	m_node(rhs.node()), m_map(const_cast<typename rde::hash_map<TKey, TValue>*>(rhs.get_map()))
 								{/**/}

 							TRef operator*() const


== Qfalse -> !RTEST

== Qfalse -> !RTEST

git-svn-id: 38c604b3104e32f2a99bb63601c3e294170c19ce@65 425b54fa-293c-0410-bdda-a7e424c12f17

--- texture.c
+++ texture.c
@@ -32,7 +32,7 @@
 {
   char* path = StringValuePtr(rbPath);

-  if (rb_funcall(rb_mFileTest, rb_intern("file?"), 1, rbPath) == Qfalse) {
+  if (!RTEST(rb_funcall(rb_mFileTest, rb_intern("file?"), 1, rbPath))) {
     VALUE rbPathes = rb_funcall(rb_cDir, rb_intern("[]"), 1,
                                 rb_str_cat2(rb_str_dup(rbPath), ".*"));
     if (1 <= RARRAY(rbPathes)->len) {


Optimized Texture#render_texture

Optimized Texture#render_texture

git-svn-id: 38c604b3104e32f2a99bb63601c3e294170c19ce@515 425b54fa-293c-0410-bdda-a7e424c12f17

--- texture.c
+++ texture.c
@@ -851,19 +851,31 @@
   if (scaleX != 1 || scaleY != 1 || angle != 0) {
     mat.tx -= centerX;
     mat.ty -= centerY;
-    if (scaleX != 1 || scaleY != 1) {
-      AffineMatrix_Concat(&mat, &(AffineMatrix) {
-        .a = scaleX, .b = 0,      .tx = 0,
-        .c = 0,      .d = scaleY, .ty = 0,
-      });
+    if (scaleX != 1) {
+      mat.a  *= scaleX;
+      mat.b  *= scaleX;
+      mat.tx *= scaleX;
+    }
+    if (scaleY != 1) {
+      mat.c  *= scaleX;
+      mat.d  *= scaleX;
+      mat.ty *= scaleX;
     }
     if (angle != 0) {
-      double c = cos(angle);
-      double s = sin(angle);
-      AffineMatrix_Concat(&mat, &(AffineMatrix) {
-        .a = c, .b = -s, .tx = 0,
-        .c = s, .d = c,  .ty = 0,
-      });
+      double a  = mat.a;
+      double b  = mat.b;
+      double c  = mat.c;
+      double d  = mat.d;
+      double tx = mat.tx;
+      double ty = mat.ty;
+      double cosAngle = cos(angle);
+      double sinAngle = sin(angle);
+      mat.a  = cosAngle * a  - sinAngle * c;
+      mat.b  = cosAngle * b  - sinAngle * d;
+      mat.c  = sinAngle * a  + cosAngle * c;
+      mat.d  = sinAngle * b  + cosAngle * d;
+      mat.tx = cosAngle * tx - sinAngle * ty;
+      mat.ty = sinAngle * tx + cosAngle * ty;
     }
     mat.tx += centerX;
     mat.ty += centerY;


add an assert for adding singleton components via regular component constructor (as they have the same registration info), this would cause 'intersting effects' (data corruption)

--- UnnamedEngine/Sources/Engine/Base/Managers/EntityAdmin.h
+++ UnnamedEngine/Sources/Engine/Base/Managers/EntityAdmin.h
@@ -43,6 +43,7 @@
 	// allocation on dependency loading...
 	Ptr<ComponentBase> AddComponent(ComponentFlag flag, StorageStrategy s, size_t componentSize, Entity entity)
 	{
+		assert(s != StorageStrategy::Singleton);
 		const uint32_t eid = entity.GetIndex();

 		if(mComponentPools.size() <= flag || !mComponentPools[static_cast<int>(flag)])
@@ -85,11 +86,6 @@

 	void ExpandPoolList(ComponentFlag flag, StorageStrategy s, size_t blockSize)
 	{
-		if(s == StorageStrategy::Singleton)
-		{
-
-		}
-
 		if(mComponentPools.size() < static_cast<size_t>(flag) + 1)
 		{
 			mComponentPools.resize(static_cast<size_t>(flag + 1));


more tweeks to SharedPtr<T> stuff

more tweeks to SharedPtr<T> stuff

--- Library/Sources/Stroika/Foundation/Memory/SharedPtr.h
+++ Library/Sources/Stroika/Foundation/Memory/SharedPtr.h
@@ -403,7 +403,7 @@
 			 *		typedef	SharedPtr<VeryFancyObj,SharedPtr_SharedPtrBase_TraitsVeryFancyObj>>	VeryFancySmartPointer;
 			 *
 			 *		THEN - VeryFancySmartPointer will work like a regular smart pointer - EXCEPT THAT IN ADDITION, you can ALWAYS safely create
-			 *		a VeryFancySmartPointer from an already existing VeryFancyObj - just by wrapping/construciting the smart pointer (because the reference count is
+			 *		a VeryFancySmartPointer from an already existing VeryFancyObj - just by wrapping/constructing the smart pointer (because the reference count is
 			 *		already in the base wrapped data type).
 			 */
 			template	<typename	T>
@@ -427,10 +427,21 @@
 			// a layer of code, and then re-constitute the SharedPtr<> part later.
 			template	<typename	T>
 				struct	enable_shared_from_this : Private::SharedPtrBase_ {
-					SharedPtr<T,SharedPtr_SharedPtrBase_Traits<T>> shared_from_this()
+					SharedPtr<T,SharedPtr_SharedPtrBase_Traits<T>> shared_from_this ()
 						{
-enable_shared_from_this* tmp = (enable_shared_from_this*)this;//debug why needed on msvc - try on linux
-							return (SharedPtr<T,SharedPtr_SharedPtrBase_Traits<T>> (tmp));
+							/*
+							 * The Constructor for SharedPtr<T> expects a T*. However, we don't have a T*. But recall,
+							 * the ONLY legal way to use this enable_shared_from_this is:
+							 *
+							 * 		struct	TTT : Memory::enable_shared_from_this<TTT> {
+							 *			string x;
+							 *			....
+							 *		};
+							 *
+							 *	and so if we have a legal pointer to enable_shared_from_this<T>, then it MUST also be castable to a pointer to T*!!!
+							 */
+							T*	tStarThis	=	static_cast<T*> (this);
+							return (SharedPtr<T,SharedPtr_SharedPtrBase_Traits<T>> (tStarThis));
 						}
 				};


touchscreen.c: print transformation matrix.


Fix resetModule and powerDownModule to compile with the newest changes

--- Arduino/chorus_rf_laptimer/rx5808spi.h
+++ Arduino/chorus_rf_laptimer/rx5808spi.h
@@ -115,45 +115,21 @@
 }

 void powerDownModule() {
-    cli();
-    SERIAL_ENABLE_HIGH();
-    SERIAL_ENABLE_LOW();
-
-    // send 0x0A
-    SERIAL_SENDBIT0();
-    SERIAL_SENDBIT1();
-    SERIAL_SENDBIT0();
-    SERIAL_SENDBIT1();
-
-    // write
-    SERIAL_SENDBIT1();
-
-    // set all bits to one -> disable all modules
-     for (uint8_t i = 20; i > 0; i--) {
-        SERIAL_SENDBIT1();
-    }
-    // Finished clocking data in
-    SERIAL_ENABLE_HIGH();
-    delayMicroseconds(1);
-
+    // Power down all features
+    PowerDownFeatures(PD_PLL1D8 | PD_DIV80 | PD_MIXER | PD_IFABF | PD_REG1D8 | PD_6M5 | PD_AU6M5 | PD_6M | PD_AU6M | PD_SYN | PD_5GVCO | PD_DIV4 | PD_DIV4 | PD_BC | PD_REGIF | PD_REGBS | PD_RSSI_SQUELCH | PD_IFAF | PD_IF_DEMOD | PD_VAMP | PD_VCLAMP);
+}
+
+// Reset needs to be used to wake the module up if it is completely powered down
+void resetModule() {
+    digitalLow(spiClockPin);
     digitalLow(slaveSelectPin);
-    digitalLow(spiClockPin);
-    digitalLow(spiDataPin);
-    sei();
-
-    delay(MIN_TUNE_TIME);
-}
-
-void resetModule() {
-    cli();
-    SERIAL_ENABLE_HIGH();
-    SERIAL_ENABLE_LOW();
-
-    // State register
-    SERIAL_SENDBIT0();
-    SERIAL_SENDBIT0();
-    SERIAL_SENDBIT0();
-    SERIAL_SENDBIT0();
+    delayMicroseconds(1);
+
+    // State register 0x0F
+    SERIAL_SENDBIT1();
+    SERIAL_SENDBIT1();
+    SERIAL_SENDBIT1();
+    SERIAL_SENDBIT1();

     // write
     SERIAL_SENDBIT1();
@@ -164,13 +140,8 @@
     }

     // Finished clocking data in
-    SERIAL_ENABLE_HIGH();
-    delayMicroseconds(1);
-
-    digitalLow(slaveSelectPin);
-    digitalLow(spiClockPin);
-    digitalLow(spiDataPin);
-    sei();
+    digitalHigh(slaveSelectPin);
+    delayMicroseconds(1);

     delay(MIN_TUNE_TIME);
 }


Fix icc warnings for xpt_file

Fix icc warnings for xpt_file

git-svn-id: 51d371801c0de2a0625fbca80cd99d181c32913f@13364 dc4e9af1-7f46-4ead-bba6-71afc04862de

--- code/src/xpt_file.c
+++ code/src/xpt_file.c
@@ -412,7 +412,7 @@

   uint32_t block = (uint32_t) (val_offset / XLB_XPT_BLOCK_SIZE);
   uint32_t block_pos = (uint32_t) (val_offset % XLB_XPT_BLOCK_SIZE);
-  void *buf_pos = buffer;
+  char *buf_pos = (char*)buffer;
   size_t val_remaining = (size_t)val_len;
   DEBUG("Reading val %zu bytes @ offset %llu of current file",
         val_remaining , (long long unsigned) val_offset);
@@ -567,7 +567,7 @@
 {
   assert(state->file != NULL);
   DEBUG("Select rank %"PRIu32" for reading", rank);
-  CHECK_MSG(rank >= 0 && rank < state->ranks, "Invalid rank: %"PRId32, rank);
+  CHECK_MSG(rank < state->ranks, "Invalid rank: %"PRId32, rank);
   state->curr_rank = rank;
   uint32_t rank_block1 = first_block(state->curr_rank, state->ranks);
   adlb_code rc = block_read_move(state, rank_block1);
@@ -986,6 +986,8 @@
 {
   TRACE("bufwrite %zu bytes", length);

+  const char *data_ptr = (const char*)data;
+
   if (state->curr_block_pos == 0 && state->buffer_used == 0)
   {
     // Make sure magic number gets written in case where buffer
@@ -1023,7 +1025,7 @@

     TRACE("Append %zu bytes to write buffer (%zu already used)", write_size,
           state->buffer_used);
-    memcpy(state->buffer + state->buffer_used, data, write_size);
+    memcpy(state->buffer + state->buffer_used, data_ptr, write_size);

     // Update buffer size before calling flush_buffers
     state->buffer_used += write_size;
@@ -1034,7 +1036,7 @@
       ADLB_CHECK(ac);
     }

-    data += write_size;
+    data_ptr += write_size;
     length -= write_size;

     if (append_magic_num)
@@ -1142,11 +1144,12 @@
                                  size_t length)
 {
   assert(state->file != NULL);
-  assert(state->curr_block_pos >= 0);
   assert(state->curr_block_pos <= state->block_size);

   if (state->end_of_stream)
     return ADLB_DONE;
+
+  char *buf_ptr = (char*)buf;

   adlb_code ac;
   while (length > 0)
@@ -1162,7 +1165,7 @@
     }

     size_t read_length = block_left < length ? block_left : length;
-    ac = checked_fread(state, buf, read_length);
+    ac = checked_fread(state, buf_ptr, read_length);
     if (ac == ADLB_DONE)
     {
       state->end_of_stream = true;
@@ -1173,7 +1176,7 @@
     }

     length -= read_length;
-    buf += read_length;
+    buf_ptr += read_length;
   } while (length > 0);
   return ADLB_SUCCESS;
 }
@@ -1181,7 +1184,6 @@
 static adlb_code blkgetc(xlb_xpt_read_state *state, unsigned char *c)
 {
   assert(state->file != NULL);
-  assert(state->curr_block_pos >= 0);
   assert(state->curr_block_pos <= state->block_size);

   if (state->end_of_stream)


- code cleanup. - create surface before creating a texture

--- monochrome/c/monochrome.c
+++ monochrome/c/monochrome.c
@@ -32,123 +32,83 @@

 int main(int argc, char *argv[])
 {
-    SDL_Window *window;
-    SDL_Renderer *renderer;
-    SDL_Texture *texture;
     Uint32 flags;
     int i, w, h, done;
-    SDL_Event event;
+
+    SDL_Window   *window = NULL;
+    SDL_Renderer *renderer = NULL;
+    SDL_Texture  *texture = NULL;
+    SDL_Surface  *img_surface = NULL;
+    SDL_Event     event;
+
     const char *saveFile = NULL;
+    const char *img_name = NULL;

-    /* Check command line usage */
-    if ( ! argv[1] ) {
-        fprintf(stderr, "Usage: %s [-fullscreen] [-save file.png] <image_file> ...\n", argv[0]);
-        return(1);
+    if(argc != 2)
+    {
+        fprintf(stderr, "Usage: %s <image_file> \n", argv[0]);
+        return -1;
     }

-    flags = SDL_WINDOW_HIDDEN;
-    for ( i=1; argv[i]; ++i ) {
-        if ( strcmp(argv[i], "-fullscreen") == 0 ) {
-            SDL_ShowCursor(0);
-            flags |= SDL_WINDOW_FULLSCREEN;
-        }
+    img_name = argv[1];
+
+    if (SDL_CreateWindowAndRenderer(0, 0, flags, &window, &renderer) < 0)
+    {
+        fprintf(stderr, "SDL_CreateWindowAndRenderer() failed: %s\n", SDL_GetError());
+        return -2;
     }

-    if (SDL_CreateWindowAndRenderer(0, 0, flags, &window, &renderer) < 0) {
-        fprintf(stderr, "SDL_CreateWindowAndRenderer() failed: %s\n", SDL_GetError());
-        return(2);
+    img_surface = IMG_Load(img_name);
+    if(!img_surface)
+    {
+        fprintf(stderr, "Failed to load %s.\n", img_name);
+        return -3;
     }

-    for ( i=1; argv[i]; ++i ) {
-        if ( strcmp(argv[i], "-fullscreen") == 0 ) {
-            continue;
-        }
+    texture = SDL_CreateTextureFromSurface(renderer, img_surface);
+    if (!texture)
+    {
+        fprintf(stderr, "Couldn't create texture from surface!\n");
+        return -1;
+    }
+    SDL_QueryTexture(texture, NULL, NULL, &w, &h);

-        if ( strcmp(argv[i], "-save") == 0 && argv[i+1] ) {
-            ++i;
-            saveFile = argv[i];
-            continue;
-        }
+    SDL_SetWindowTitle(window, argv[i]);
+    SDL_SetWindowSize(window, w, h);
+    SDL_ShowWindow(window);

-        /* Open the image file */
-        texture = IMG_LoadTexture(renderer, argv[i]);
-        if (!texture) {
-            fprintf(stderr, "Couldn't load %s: %s\n", argv[i], SDL_GetError());
-            continue;
-        }
-        SDL_QueryTexture(texture, NULL, NULL, &w, &h);
-
-        /* Save the image file, if desired */
-        if ( saveFile ) {
-            SDL_Surface *surface = IMG_Load(argv[i]);
-            if (surface) {
-                if ( IMG_SavePNG(surface, saveFile) < 0 ) {
-                    fprintf(stderr, "Couldn't save %s: %s\n", saveFile, SDL_GetError());
-                }
-            } else {
-                fprintf(stderr, "Couldn't load %s: %s\n", argv[i], SDL_GetError());
+    done = 0;
+    while(!done)
+    {
+        while(SDL_PollEvent(&event))
+        {
+            switch (event.type)
+            {
+                case SDL_KEYUP:
+                    switch (event.key.keysym.sym) {
+                        case SDLK_ESCAPE:
+                            done = 1;
+                        default:
+                            break;
+                    }
+                    break;
+                case SDL_QUIT:
+                    done = 1;
+                    break;
+                default:
+                    break;
             }
         }
+        draw_background(renderer, w, h);

-        /* Show the window */
-        SDL_SetWindowTitle(window, argv[i]);
-        SDL_SetWindowSize(window, w, h);
-        SDL_ShowWindow(window);
+        SDL_RenderCopy(renderer, texture, NULL, NULL);
+        SDL_RenderPresent(renderer);

-        done = 0;
-        while ( ! done ) {
-            while ( SDL_PollEvent(&event) ) {
-                switch (event.type) {
-                    case SDL_KEYUP:
-                        switch (event.key.keysym.sym) {
-                            case SDLK_LEFT:
-                                if ( i > 1 ) {
-                                    i -= 2;
-                                    done = 1;
-                                }
-                                break;
-                            case SDLK_RIGHT:
-                                if ( argv[i+1] ) {
-                                    done = 1;
-                                }
-                                break;
-                            case SDLK_ESCAPE:
-                            case SDLK_q:
-                                argv[i+1] = NULL;
-                            /* Drop through to done */
-                            case SDLK_SPACE:
-                            case SDLK_TAB:
-                            done = 1;
-                            break;
-                            default:
-                            break;
-                        }
-                        break;
-                    case SDL_MOUSEBUTTONDOWN:
-                        done = 1;
-                        break;
-                    case SDL_QUIT:
-                        argv[i+1] = NULL;
-                        done = 1;
-                        break;
-                    default:
-                        break;
-                }
-            }
-            /* Draw a background pattern in case the image has transparency */
-            draw_background(renderer, w, h);
+        SDL_Delay(100);
+    }
+    SDL_DestroyTexture(texture);

-            /* Display the image */
-            SDL_RenderCopy(renderer, texture, NULL, NULL);
-            SDL_RenderPresent(renderer);
-
-            SDL_Delay(100);
-        }
-        SDL_DestroyTexture(texture);
-    }
-
-    /* We're done! */
     SDL_Quit();
-    return(0);
+    return 0;
 }


Lets tile world correct output

Lets tile world correct output

	modified:   src/video/playbook/SDL_playbookvideo.c

--- src/video/playbook/SDL_playbookvideo.c
+++ src/video/playbook/SDL_playbookvideo.c
@@ -202,6 +202,7 @@
 SDL_Surface *PLAYBOOK_SetVideoMode(_THIS, SDL_Surface *current,
 				int width, int height, int bpp, Uint32 flags)
 {
+
 	if (m_buffer) {
 		SDL_free(m_buffer);
 	}
@@ -249,15 +250,15 @@
 				return NULL;
 			}

-			int size[2] = {width, height};
-			rc = screen_set_window_property_iv(screenWindow, SCREEN_PROPERTY_SIZE, size);
+			int sizeOfWindow[2] = {1024, 600};
+			rc = screen_set_window_property_iv(screenWindow, SCREEN_PROPERTY_SIZE, sizeOfWindow);
 			if (rc) {
 				SDL_SetError("Cannot resize window: %s", strerror(errno));
 				screen_destroy_window(screenWindow);
 				return NULL;
 			}
-
-			rc = screen_set_window_property_iv(screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, size);
+			int sizeOfBuffer[2] = {width, height};
+			rc = screen_set_window_property_iv(screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, sizeOfBuffer);
 			if (rc) {
 				SDL_SetError("Cannot resize window buffer: %s", strerror(errno));
 				screen_destroy_window(screenWindow);


Mode 5

Mode 5

--- src/gba/renderers/video-software.c
+++ src/gba/renderers/video-software.c
@@ -29,6 +29,7 @@
 static void _drawBackgroundMode2(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int y);
 static void _drawBackgroundMode3(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int y);
 static void _drawBackgroundMode4(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int y);
+static void _drawBackgroundMode5(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int y);
 static void _preprocessTransformedSprite(struct GBAVideoSoftwareRenderer* renderer, struct GBATransformedObj* sprite, int y);
 static void _preprocessSprite(struct GBAVideoSoftwareRenderer* renderer, struct GBAObj* sprite, int y);
 static void _postprocessSprite(struct GBAVideoSoftwareRenderer* renderer, int priority);
@@ -452,6 +453,9 @@
 				break;
 			case 4:
 				_drawBackgroundMode4(renderer, &renderer->bg[2], y);
+				break;
+			case 5:
+				_drawBackgroundMode5(renderer, &renderer->bg[2], y);
 				break;
 			}
 			renderer->bg[2].sx += renderer->bg[2].dmx;
@@ -811,6 +815,7 @@
 }

 #define BACKGROUND_BITMAP_INIT \
+	(void)(unused); \
 	int32_t x = background->sx - background->dx; \
 	int32_t y = background->sy - background->dy; \
 	int32_t localX; \
@@ -821,11 +826,11 @@
 	flags |= FLAG_TARGET_2 * background->target2; \
 	int variant = background->target1 && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN);

-#define BACKGROUND_BITMAP_ITERATE \
+#define BACKGROUND_BITMAP_ITERATE(W, H) \
 	x += background->dx; \
 	y += background->dy; \
 	\
-	if (x < 0 || y < 0 || (x >> 8) >= VIDEO_HORIZONTAL_PIXELS || (y >> 8) >= VIDEO_VERTICAL_PIXELS) { \
+	if (x < 0 || y < 0 || (x >> 8) >= W || (y >> 8) >= H) { \
 		continue; \
 	} else { \
 		localX = x; \
@@ -833,7 +838,6 @@
 	}

 static void _drawBackgroundMode2(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int unused) {
-	(void)(unused);
 	int sizeAdjusted = 0x8000 << background->size;

 	BACKGROUND_BITMAP_INIT;
@@ -871,8 +875,6 @@
 }

 static void _drawBackgroundMode3(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int unused) {
-	(void)(unused);
-
 	BACKGROUND_BITMAP_INIT;

 	uint16_t color;
@@ -880,7 +882,7 @@

 	int outX;
 	for (outX = 0; outX < VIDEO_HORIZONTAL_PIXELS; ++outX) {
-		BACKGROUND_BITMAP_ITERATE;
+		BACKGROUND_BITMAP_ITERATE(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);

 		color = ((uint16_t*)renderer->d.vram)[(localX >> 8) + (localY >> 8) * VIDEO_HORIZONTAL_PIXELS];
 		color32 = 0;
@@ -901,8 +903,6 @@
 }

 static void _drawBackgroundMode4(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int unused) {
-	(void)(unused);
-
 	BACKGROUND_BITMAP_INIT;

 	uint16_t color;
@@ -913,7 +913,7 @@

 	int outX;
 	for (outX = 0; outX < VIDEO_HORIZONTAL_PIXELS; ++outX) {
-		BACKGROUND_BITMAP_ITERATE;
+		BACKGROUND_BITMAP_ITERATE(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);

 		color = ((uint8_t*)renderer->d.vram)[offset + (localX >> 8) + (localY >> 8) * VIDEO_HORIZONTAL_PIXELS];

@@ -922,6 +922,38 @@
 				_composite(renderer, outX, renderer->normalPalette[color] | flags);
 			} else {
 				_composite(renderer, outX, renderer->variantPalette[color] | flags);
+			}
+		}
+	}
+}
+
+static void _drawBackgroundMode5(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int unused) {
+	BACKGROUND_BITMAP_INIT;
+
+	uint16_t color;
+	uint32_t color32;
+	uint32_t offset = 0;
+	if (renderer->dispcnt.frameSelect) {
+		offset = 0xA000;
+	}
+
+	int outX;
+	for (outX = 0; outX < VIDEO_HORIZONTAL_PIXELS; ++outX) {
+		BACKGROUND_BITMAP_ITERATE(160, 128);
+
+		color = ((uint16_t*)renderer->d.vram)[(localX >> 8) + (localY >> 8) * 160];
+		color32 = 0;
+		color32 |= (color << 3) & 0xF8;
+		color32 |= (color << 6) & 0xF800;
+		color32 |= (color << 9) & 0xF80000;
+
+		if (!(renderer->row[outX] & FLAG_FINALIZED)) {
+			if (!variant) {
+				_composite(renderer, outX, color32 | flags);
+			} else if (renderer->blendEffect == BLEND_BRIGHTEN) {
+				_composite(renderer, outX, _brighten(color32, renderer->bldy) | flags);
+			} else if (renderer->blendEffect == BLEND_DARKEN) {
+				_composite(renderer, outX, _darken(color32, renderer->bldy) | flags);
 			}
 		}
 	}


ncd: NCDModule: remove redundant assignment in debug mode

--- ncd/NCDModule.c
+++ ncd/NCDModule.c
@@ -342,9 +342,11 @@
     // set state
     set_process_state(o, PROCESS_STATE_INIT);

+#ifndef NDEBUG
     // clear interp functions so we can assert they were set
     o->interp_func_event = NULL;
     o->interp_func_getobj = NULL;
+#endif

     // init interpreter part
     if (!(n->params->iparams->func_initprocess(n->params->iparams->user, o, template_name))) {


examples/elements.c: Resolve unused include of <wchar.h>

--- expat/examples/elements.c
+++ expat/examples/elements.c
@@ -49,7 +49,6 @@
 #endif

 #ifdef XML_UNICODE_WCHAR_T
-#  include <wchar.h>
 #  define XML_FMT_STR "ls"
 #else
 #  define XML_FMT_STR "s"


This the modification of the vec_move instructions to do encoding

--- src/generator_dense_instructions.c
+++ src/generator_dense_instructions.c
@@ -40,6 +40,28 @@
 /* TODO change this */
 int libxsmm_jit_code = 0;

+// This routine is for the jit code. All offsets/displacements have similar
+// byte patterns, so this is used for all of them
+static inline int add_offset ( int place1, int place2, int offset,
+                               int forced, int sizereg, unsigned char *buf )
+{
+   if ( (offset == 0) && (forced==0) ) return ( 0 );
+   else if ( ((offset%sizereg)==0) && (offset/sizereg <= 127) && (offset/sizereg >=-128) )
+   {
+      buf[place1] += 0x40;
+      buf[place2] = offset/sizereg;
+      return ( 1 );
+   } else {
+      unsigned char *cptr = (unsigned char *) &offset;
+      buf[place1] += 0x80;
+      buf[place2] = cptr[0];
+      buf[place2+1] = cptr[1];
+      buf[place2+2] = cptr[2];
+      buf[place2+3] = cptr[3];
+      return ( 4 );
+   }
+}
+
 void libxsmm_instruction_vec_move( libxsmm_generated_code* io_generated_code,
                                    const unsigned int      i_instruction_set,
                                    const unsigned int      i_vmove_instr,
@@ -52,6 +74,194 @@
   /* @TODO add checks in debug mode */
   if ( io_generated_code->code_type > 1 ) {
     /* @TODO-GREG call encoding here */
+    unsigned char *buf = (unsigned char *) io_generated_code->generated_code;
+    int i = io_generated_code->code_size;
+    int maxsize = io_generated_code->buffer_size;
+    int iregnum = i_gp_reg_number % 8;
+    int vregnum = i_vec_reg_number_0 % 8;
+    int ivectype=0, ivectype2=0, iregoff=0, vregoffset2=0, ivectype3=0;
+    int aligned=0, forced_offset=0, penultimate=0;
+    int place, num=0, vregoffset=0, num2=0, num3=0, sizereg=1;
+    int maskingoff=0;
+    int bytes = 4; // base number of bytes
+
+    int i_mask_reg_number = 1; // change if you don't want k1
+
+    if ( (i_vector_name != 'z') && (i_use_masking!=0) )
+    {
+       fprintf(stderr,"Masking is only enabled with zmm registers!\n");
+       exit(-1);
+    }
+    if ( maxsize - i < 20 )
+    {
+       fprintf(stderr,"Most instructions need at most 20 bytes\n");
+       exit(-1);
+    }
+    num = i_vec_reg_number_0 / 8;
+    switch ( i_vmove_instr ) {
+       case LIBXSMM_X86_INSTR_VMOVAPD:
+          aligned += 0x18;
+          if ( i_vector_name=='x' ) ivectype += 1;
+          if ( num == 1 ) ivectype3 -= 0x80;
+          ivectype2 += 0x81;
+          sizereg = 64;
+          break;
+       case LIBXSMM_X86_INSTR_VMOVAPS:
+          aligned += 0x18;
+          if ( num == 1 ) ivectype3 -= 0x80;
+          if ( i_vector_name!='x' ) ivectype -= 1; // single
+          sizereg = 64;
+          break;
+       case LIBXSMM_X86_INSTR_VMOVSS:
+          if ( i_vector_name!='x' )
+          {
+             fprintf(stderr,"You want to use vmovss without xmm? ha!\n");
+             exit(-1);
+          }
+          ivectype += 2;
+          break;
+       case LIBXSMM_X86_INSTR_VMOVSD:
+          if ( i_vector_name!='x' )
+          {
+             fprintf(stderr,"You want to use vmovsd without xmm? ha!\n");
+             exit(-1);
+          }
+          ivectype += 3;
+          break;
+       case LIBXSMM_X86_INSTR_VBROADCASTSD:
+          bytes = 5;
+          if ( i_vector_name=='x' )
+          {
+             fprintf(stderr,"vbroadcastsd and xmm? Fool!\n");
+             exit(-1);
+          }
+          if ( i_is_store == 1 )
+          {
+             fprintf(stderr,"vbroadcastsd and stores? I wish!\n");
+             exit(-1);
+          }
+          ivectype2 += 0x81;
+          penultimate += 9;
+          num2 += 1;
+          num3 += 0x21;
+          sizereg = 8;
+          break;
+       case LIBXSMM_X86_INSTR_VBROADCASTSS:
+          if ( i_vector_name=='x' )
+          {
+             fprintf(stderr,"vbroadcastss and xmm? Fool!\n");
+             exit(-1);
+          }
+          if ( i_is_store == 1 )
+          {
+             fprintf(stderr,"vbroadcastss and stores? I wish!\n");
+             exit(-1);
+          }
+          bytes = 5;
+          ivectype2 += 0x1;
+          penultimate += 8;
+          sizereg = 4;
+          num2 += 1;
+          num3 += 0x21;
+          break;
+       case LIBXSMM_X86_INSTR_VMOVUPD:
+          if ( i_vector_name=='x' ) ivectype += 1;
+          if ( num == 1 ) ivectype3 -= 0x80;
+          sizereg = 64;
+          ivectype2 += 0x81;
+          break;
+       case LIBXSMM_X86_INSTR_VMOVUPS:
+          if ( num == 1 ) ivectype3 -= 0x80;
+          if ( i_vector_name!='x' ) ivectype -= 1; // single
+          sizereg = 64;
+          break;
+       case LIBXSMM_X86_INSTR_VMOVDDUP:
+          if ( i_is_store == 1 )
+          {
+             fprintf(stderr,"vmovddup and stores? I wish!\n");
+             exit(-1);
+          }
+          ivectype += 2;
+          ivectype2 += 0x83;
+          if ( num == 1 ) ivectype3 -= 0x80;
+          penultimate += 2;
+          sizereg = 64;
+          if ( i_vector_name=='x' ) ivectype += 1;
+          break;
+       default:
+          fprintf(stderr,"Are you looney?\n");
+          exit(-1);
+    }
+    switch ( i_vector_name ) {
+       case 'x':
+          sizereg = 1;
+          if ( num > 1 )
+          {
+             fprintf(stderr,"Are you sure xmm%d exists?\n",i_vec_reg_number_0);
+             exit(-1);
+          }
+          break;
+       case 'y':
+          ivectype += 5;
+          sizereg = 1;
+          if ( num > 2 )
+          {
+             fprintf(stderr,"Are you sure ymm%d exists?\n",i_vec_reg_number_0);
+             exit(-1);
+          }
+          break;
+       case 'z':
+          bytes = 6;
+          break;
+       default:
+          fprintf(stderr,"Exactly what sort of fp regs are you using?\n");
+          exit(-1);
+    }
+    if ( i_gp_reg_number >= 8 )
+    {
+       if ( bytes < 5 ) bytes = 5;
+       else iregoff -= 0x20;
+    }
+    if ( i_is_store == 1 )
+    {
+       aligned += 1;
+       if ( i_use_masking != 0 ) maskingoff = i_mask_reg_number;
+    } else {
+       if ( i_use_masking != 0 ) maskingoff = 0x80 + i_mask_reg_number;
+    }
+    if ( num == 0 ) vregoffset = 0x90;
+    else if ( num == 1 ) { vregoffset = 0x10; vregoffset2 = -0x80; }
+    else if ( num == 2 ) vregoffset = 0x80;
+    else if ( num == 3 ) vregoffset = 0x00;
+    if ( (iregnum == 5) && (i_displacement==0) )
+    {
+       // Registers like rbp/r13 when you have a displacement of 0, we need
+       // force the single byte of zero to appear.
+       forced_offset=1;
+    }
+
+    if ( bytes == 4 )
+    {
+       buf[i++] = 0xc5;
+       buf[i++] = 0xf8 + ivectype + ivectype3;
+    } else if ( bytes == 5 ) {
+       buf[i++] = 0xc4;
+       buf[i++] = 0xc1 + num3 + vregoffset2 + iregoff;
+       buf[i++] = 0x78 + ivectype;
+    } else if ( bytes == 6 ) {
+       buf[i++] = 0x62;
+       buf[i++] = 0x61 + vregoffset + iregoff + num2;
+       buf[i++] = 0x7c + ivectype2;
+       buf[i++] = 0x48 + maskingoff;
+    }
+    buf[i++] = 0x10 + aligned + penultimate;
+    buf[i++] = 0x00 + iregnum + 8*vregnum;
+    place = i-1;
+    if ( iregnum == LIBXSMM_X86_GP_REG_RSP ) buf[i++] = 0x24;
+    i += add_offset ( place, i, i_displacement, forced_offset, sizereg, buf );
+
+    io_generated_code->code_size = i;
+
   } else {
     char l_new_code[512];
     char l_gp_reg_name[4];


cosmetic changes

cosmetic changes

--- ncd/NCDModule.c
+++ ncd/NCDModule.c
@@ -459,17 +459,12 @@
 {
     DebugObject_Access(&o->d_obj);
     process_assert_interp(o);
-
-    switch (o->state) {
-        case PROCESS_STATE_UP: {
-            o->state = PROCESS_STATE_DOWN_WAITING;
-
-            o->handler_event(o->user, NCDMODULEPROCESS_EVENT_DOWN);
-            return;
-        } break;
-
-        default: ASSERT(0);
-    }
+    ASSERT(o->state == PROCESS_STATE_UP)
+
+    o->state = PROCESS_STATE_DOWN_WAITING;
+
+    o->handler_event(o->user, NCDMODULEPROCESS_EVENT_DOWN);
+    return;
 }

 void NCDModuleProcess_Interp_Terminated (NCDModuleProcess *o)


Initial Revision

Initial Revision

error: pathspec 'expat/xmlwf/unixfilemap.c' did not match any file(s) known to git

--- expat/xmlwf/unixfilemap.c
+++ expat/xmlwf/unixfilemap.c
@@ -0,0 +1,52 @@
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+
+#include "filemap.h"
+
+int filemap(const char *name,
+	    void (*processor)(const void *, size_t, const char *, void *arg),
+	    void *arg)
+{
+  int fd;
+  size_t nbytes;
+  struct stat sb;
+  void *p;
+
+  fd = open(name, O_RDONLY);
+  if (fd < 0) {
+    perror(name);
+    return 0;
+  }
+  if (fstat(fd, &sb) < 0) {
+    perror(name);
+    close(fd);
+    return 0;
+  }
+  if (!S_ISREG(sb.st_mode)) {
+    close(fd);
+    fprintf(stderr, "%s: not a regular file\n", name);
+    return 0;
+  }
+
+  nbytes = sb.st_size;
+  p = (void *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ,
+		   MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
+  if (p == (void *)-1) {
+    perror(name);
+    close(fd);
+    return 0;
+  }
+  processor(p, nbytes, name, arg);
+  munmap((caddr_t)p, nbytes);
+  close(fd);
+  return 1;
+}


add a description function to a branch

add a description function to a branch

--- src/Branch.h
+++ src/Branch.h
@@ -72,6 +72,23 @@
     }
     unsigned int getMaxInputCost() const { return mMaxInputCost; }

+    std::string description() {
+        std::string description;
+        for (const NodeRef& n : getNodes()) {
+            description += n->getName() + " → ";
+        }
+        return description;
+    }
+    std::string compactDescription() {
+        std::string description;
+        for (const NodeRef& n : getNodes()) {
+            std::string name = n->getName();
+            name.resize(3, ' ');
+            description += "[" + name + "] → ";
+        }
+        return description;
+    }
+
 private:
     Branch(const std::deque<NodeRef> nodes) : mNodes(nodes), mMaxInputCost(0) {}


Rename a few P2, P3, ... coefficients to A2, A3, ... missed in my previous commit.


oauth2: Fix typo

oauth2: Fix typo

Fallout from f5b66f7d681b4f4a35867c7d9dba556cad820ea0

--- src/goabackend/goaoauth2provider.c
+++ src/goabackend/goaoauth2provider.c
@@ -961,7 +961,7 @@
       url = soup_uri_to_string (uri, FALSE);
       if (!goa_oauth2_provider_process_redirect_url (provider, url, &priv->access_token, &priv->error))
         {
-          g_prefix_error (priv->error, _("Authorization response: "));
+          g_prefix_error (&priv->error, _("Authorization response: "));
           priv->error->domain = GOA_ERROR;
           priv->error->code = GOA_ERROR_NOT_AUTHORIZED;
           response_id = GTK_RESPONSE_CLOSE;


主要対称軸表示できるようになった。 master に pull-request するために、Config.h の設定をオフにした。closed #53

--- src/Config.h
+++ src/Config.h
@@ -21,7 +21,7 @@
 // #define CONFIG_DRAW_PRINCIPAL_COMPONENT_AXES_IN_GURUGURU_MODE 1

 /* fl-guruguru のぐるぐるモードで主要対象軸を表示する。 */
-#define CONFIG_DRAW_MAJOR_AXES_SYMMETRY_IN_GURUGURU_MODE 1
+// #define CONFIG_DRAW_MAJOR_AXES_SYMMETRY_IN_GURUGURU_MODE 1

 /* fl-guruguru の POVRay スナップショットの背景を透明色にする。 */
 // #define CONFIG_PAINT_TRANSPARENT_COLOR_TO_BACKGROUND_IN_POVRAY_SNAPSHOT 1


libgpaste-settings-ui: use a grid

libgpaste-settings-ui: use a grid

Signed-off-by: Marc-Antoine Perennou <07f76cf0511c79b361712839686f3cee8c75791c@Perennou.com>

--- libgpaste/settings/ui/gpaste-settings-ui-widget.c
+++ libgpaste/settings/ui/gpaste-settings-ui-widget.c
@@ -24,7 +24,7 @@
     GPasteSettingsUiStack *stack;
 };

-G_DEFINE_TYPE_WITH_PRIVATE (GPasteSettingsUiWidget, g_paste_settings_ui_widget, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GPasteSettingsUiWidget, g_paste_settings_ui_widget, GTK_TYPE_GRID)

 /**
  * g_paste_settings_ui_widget_get_stack:
@@ -49,18 +49,17 @@
 g_paste_settings_ui_widget_init (GPasteSettingsUiWidget *self)
 {
     GPasteSettingsUiWidgetPrivate *priv = self->priv = g_paste_settings_ui_widget_get_instance_private (self);
-
-    gtk_box_set_spacing (GTK_BOX (self), 10);
+    GtkGrid *grid = GTK_GRID (self);
+    guint current_line = 0;

     GPasteSettingsUiStack *stack = priv->stack = g_paste_settings_ui_stack_new ();
     g_paste_settings_ui_stack_fill (stack);

-    GtkContainer *box = GTK_CONTAINER (self);
-    gtk_container_add (box, gtk_widget_new (GTK_TYPE_STACK_SWITCHER,
-                                            "stack",  GTK_STACK (stack),
-                                            "halign", GTK_ALIGN_CENTER,
-                                            NULL));
-    gtk_container_add (box, GTK_WIDGET (stack));
+    gtk_grid_attach (grid, gtk_widget_new (GTK_TYPE_STACK_SWITCHER,
+                                           "stack",  GTK_STACK (stack),
+                                           "halign", GTK_ALIGN_CENTER,
+                                           NULL), 0, current_line++, 1, 1);
+    gtk_grid_attach (grid, GTK_WIDGET (stack), 0, current_line++, 1, 1);
 }

 /**
@@ -73,7 +72,5 @@
  */
 G_PASTE_VISIBLE GtkWidget *
 g_paste_settings_ui_widget_new (void) {
-    return gtk_widget_new (G_PASTE_TYPE_SETTINGS_UI_WIDGET,
-                           "orientation", GTK_ORIENTATION_VERTICAL,
-                           NULL);
+    return gtk_widget_new (G_PASTE_TYPE_SETTINGS_UI_WIDGET, NULL);
 }


Use normalizeIn in coppersmith-invariant-factors

--- linbox/algorithms/coppersmith-invariant-factors.h
+++ linbox/algorithms/coppersmith-invariant-factors.h
@@ -167,7 +167,7 @@
 		SFKB.solve(diag,MM);

 		for (uint32_t i = 0; i < diag.size(); ++i) {
-			R.normalize(diag[i],diag[i]);
+			R.normalizeIn(diag[i]);
 		}

 		return diag.size();


Fix source tag for async result in IPA discovery

 * This is unused by the current code

--- service/realm-ipa-discover.c
+++ service/realm-ipa-discover.c
@@ -286,7 +286,7 @@
   data = g_bytes_get_data (bytes, &size);
   simple = g_simple_async_result_new (G_OBJECT (stream),
                                       callback, user_data,
-                                      g_output_stream_write_bytes_async);
+                                      write_all_bytes_async);
   closure = g_slice_new0 (WriteAllClosure);
   closure->bytes = g_bytes_ref (bytes);
   g_simple_async_result_set_op_res_gpointer (simple, closure, write_all_closure_free);


add L/R reaction coordinate

add L/R reaction coordinate

--- src/penalty.h
+++ src/penalty.h
@@ -114,6 +114,7 @@
             public:
                 template<class Tspace>
                     MoleculeProperty(const json &j, Tspace &spc) {
+                        typedef typename Tspace::Tparticle Tparticle;
                         name = "molecule";
                         from_json(j, *this);
                         index = j.value("index", 0);
@@ -188,6 +189,30 @@
                                 auto cm1 = Geometry::massCenter(spc.p.begin()+i, spc.p.begin()+j, spc.geo.getBoundaryFunc());
                                 auto cm2 = Geometry::massCenter(spc.p.begin()+k, spc.p.begin()+l, spc.geo.getBoundaryFunc());
                                 return spc.geo.vdist(cm1, cm2).cwiseProduct(dir.cast<double>()).norm();
+                            };
+                        }
+
+                        else if (property=="L/R") {
+                            dir = j.at("dir");
+                            indexes = j.value("indexes", decltype(indexes)());
+                            assert(indexes.size()==2 && "An array of 2 indexes should be specified.");
+                            f = [&spc, &dir=dir, i=indexes[0], j=indexes[1]]() {
+                                Average<double> Rj, Rin, Rout;
+                                Group<Tparticle> g(spc.p.begin(), spc.p.end());
+                                auto slicei = g.find_id(i);
+                                auto cm = Geometry::massCenter(slicei.begin(), slicei.end(), spc.geo.getBoundaryFunc());
+                                auto slicej = g.find_id(j);
+                                for (auto p : slicej)
+                                    Rj += spc.geo.vdist(p.pos, cm).cwiseProduct(dir.cast<double>()).norm();
+                                double Rjavg = Rj.avg();
+                                for (auto p : slicei) {
+                                    double d = spc.geo.vdist(p.pos, cm).cwiseProduct(dir.cast<double>()).norm();
+                                    if (d < Rjavg)
+                                        Rin += d;
+                                    else if (d > Rjavg)
+                                        Rout += d;
+                                }
+                                return 2 * spc.geo.getLength().z() / ( Rin.avg() + Rout.avg() );
                             };
                         }


Update penalty.h

Update penalty.h

--- src/penalty.h
+++ src/penalty.h
@@ -74,7 +74,7 @@
                         if (property=="x") f = [&i=spc.p.at(index).pos]() { return i.x(); };
                         if (property=="y") f = [&i=spc.p.at(index).pos]() { return i.y(); };
                         if (property=="z") f = [&i=spc.p.at(index).pos]() { return i.z(); };
-                        if (property=="q") f = [&i=spc.p.at(index)]() 	  { return i.charge; };
+                        if (property=="q") f = [&i=spc.p.at(index)]()     { return i.charge; };
                         if (property=="R") f = [&i=spc.p.at(index).pos]() { return i.norm(); };
                         if (f==nullptr)
                             throw std::runtime_error(name + ": unknown property '" + property + "'");