support glib < 2.44

support glib < 2.44

--- service/date-daemon.h
+++ service/date-daemon.h
@@ -28,7 +28,26 @@
 G_BEGIN_DECLS

 #define DATE_TYPE_DAEMON           (date_daemon_get_type ())
+
+#if GLIB_CHECK_VERSION(2, 44, 0)
 G_DECLARE_FINAL_TYPE (DateDaemon, date_daemon, DATE, DAEMON, GObject);
+#else
+#define DATE_DAEMON(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), DATE_TYPE_DAEMON, DateDaemon))
+#define DATE_DAEMON_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), DATE_TYPE_DAEMON, DateDaemonClass))
+#define DATE_IS_DAEMON(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DATE_TYPE_DAEMON))
+#define DATE_IS_DAEMON_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), DATE_TYPE_DAEMON))
+#define DATE_DAEMON_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), DATE_TYPE_DAEMON, DateDaemonClass))
+
+typedef struct _DateDaemon                DateDaemon;
+typedef struct _DateDaemonClass           DateDaemonClass;
+typedef struct _DateDaemonPrivate         DateDaemonPrivate;
+
+struct _DateDaemonClass
+{
+       GObjectClass     parent_class;
+};
+GType     date_daemon_get_type                   (void) G_GNUC_CONST;
+#endif

 DateDaemon*     date_daemon_new    (GMainLoop *loop, gboolean replace);


Add IPv6 support to udp:sendto()

Add IPv6 support to udp:sendto()

--- src/udp.c
+++ src/udp.c
@@ -153,16 +153,37 @@
     const char *ip = luaL_checkstring(L, 3);
     unsigned short port = (unsigned short) luaL_checknumber(L, 4);
     p_timeout tm = &udp->tm;
-    struct sockaddr_in addr;
     int err;
-    memset(&addr, 0, sizeof(addr));
-    if (!inet_aton(ip, &addr.sin_addr))
-        luaL_argerror(L, 3, "invalid ip address");
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(port);
-    timeout_markstart(tm);
-    err = socket_sendto(&udp->sock, data, count, &sent,
-            (SA *) &addr, sizeof(addr), tm);
+    switch (udp->family) {
+	case PF_INET: {
+	    struct sockaddr_in addr;
+	    memset(&addr, 0, sizeof(addr));
+	    if (!inet_pton(AF_INET, ip, &addr.sin_addr))
+		luaL_argerror(L, 3, "invalid ip address");
+	    addr.sin_family = AF_INET;
+	    addr.sin_port = htons(port);
+	    timeout_markstart(tm);
+	    err = socket_sendto(&udp->sock, data, count, &sent,
+		    (SA *) &addr, sizeof(addr), tm);
+	    break;
+	}
+	case PF_INET6: {
+	    struct sockaddr_in6 addr;
+	    memset(&addr, 0, sizeof(addr));
+	    if (!inet_pton(AF_INET6, ip, &addr.sin6_addr))
+		luaL_argerror(L, 3, "invalid ip address");
+	    addr.sin6_family = AF_INET6;
+	    addr.sin6_port = htons(port);
+	    timeout_markstart(tm);
+	    err = socket_sendto(&udp->sock, data, count, &sent,
+		    (SA *) &addr, sizeof(addr), tm);
+	    break;
+	}
+	default:
+            lua_pushnil(L);
+            lua_pushfstring(L, "unknown family %d", udp->family);
+            return 2;
+    }
     if (err != IO_DONE) {
         lua_pushnil(L);
         lua_pushstring(L, udp_strerror(err));


widget: Set the ring's in-memory size on terminal reset

--- src/vte.c
+++ src/vte.c
@@ -12414,8 +12414,10 @@
 	if (clear_history) {
 		_vte_ring_fini(pvt->normal_screen.row_data);
 		_vte_ring_init(pvt->normal_screen.row_data, pvt->scrollback_lines);
+                _vte_ring_set_visible_rows_hint(pvt->normal_screen.row_data, pvt->row_count);
 		_vte_ring_fini(pvt->alternate_screen.row_data);
-		_vte_ring_init(pvt->alternate_screen.row_data, terminal->pvt->row_count);
+		_vte_ring_init(pvt->alternate_screen.row_data, pvt->row_count);
+                _vte_ring_set_visible_rows_hint(pvt->alternate_screen.row_data, pvt->row_count);
 		pvt->normal_screen.cursor_saved.row = 0;
 		pvt->normal_screen.cursor_saved.col = 0;
 		pvt->normal_screen.cursor_current.row = 0;


Don't fake cursor keys on normal screen with restricted scrolling.

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

--- src/vte.c
+++ src/vte.c
@@ -11505,9 +11505,8 @@
 		return FALSE;
 	}

-	if ((terminal->pvt->screen == &terminal->pvt->alternate_screen &&
-             terminal->pvt->alternate_screen_scroll) ||
-            terminal->pvt->normal_screen.scrolling_restricted) {
+	if (terminal->pvt->screen == &terminal->pvt->alternate_screen &&
+            terminal->pvt->alternate_screen_scroll) {
 		char *normal;
 		gssize normal_length;
 		const gchar *special;


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

--- MagickCore/statistic.c
+++ MagickCore/statistic.c
@@ -1469,10 +1469,7 @@
     /*
        Compute center of mass (centroid).
     */
-    centroid[channel].x=image->columns/2.0;
-    centroid[channel].y=image->rows/2.0;
-    if (fabs(M00[channel]) < MagickEpsilon)
-      continue;
+    M00[channel]+=MagickEpsilon;
     centroid[channel].x=M10[channel]/M00[channel];
     centroid[channel].y=M01[channel]/M00[channel];
   }
@@ -1533,8 +1530,6 @@
     /*
       Compute elliptical angle, major and minor axes, eccentricity, & intensity.
     */
-    if (fabs(M00[channel]) < MagickEpsilon)
-      continue;
     channel_moments[channel].centroid=centroid[channel];
     channel_moments[channel].ellipse_axis.x=sqrt((2.0/M00[channel])*
       ((M20[channel]+M02[channel])+sqrt(4.0*M11[channel]*M11[channel]+
@@ -1556,8 +1551,6 @@
     /*
       Normalize image moments.
     */
-    if (fabs(M00[channel]) < MagickEpsilon)
-      continue;
     M10[channel]=0.0;
     M01[channel]=0.0;
     M11[channel]/=pow(M00[channel],1.0+(1.0+1.0)/2.0);
@@ -1576,8 +1569,6 @@
     /*
       Compute Hu invariant moments.
     */
-    if (fabs(M00[channel]) < MagickEpsilon)
-      continue;
     channel_moments[channel].I[0]=M20[channel]+M02[channel];
     channel_moments[channel].I[1]=(M20[channel]-M02[channel])*
       (M20[channel]-M02[channel])+4.0*M11[channel]*M11[channel];


add descriptions to #endif directives in turblib.h

since the #ifdef/#endif blocks are so long, I think this should be the
standard...

git-svn-id: 78680c43735c8fc1bfd988e787ae5b6171b14100@10983 743f73a2-0892-4f1a-8574-ff7a07c3af4f

--- turblib.h
+++ turblib.h
@@ -19,13 +19,13 @@

 #ifdef CUTOUT_SUPPORT
 #include "hdf5.h"
-#endif
+#endif//CUTOUT_SUPPORT

 #include "soapH.h"

 #ifdef  __cplusplus
 extern "C" {
-#endif
+#endif//__cplusplus

 #define TURBLIB_VERSION "0.2"
 #define TURB_ERROR_LENGTH 2048
@@ -166,7 +166,7 @@
   int hx, hy, hz, comps;
   int persist;
 } dataKernel;
-#endif
+#endif//CUTOUT_SUPPORT

 /* C */
 void soapinit ();
@@ -210,7 +210,7 @@
 #define getDensityGradient getDensityGradientSoap
 #define getDensityHessian getDensityHessianSoap

-#endif
+#endif//not CUTOUT_SUPPORT

 /* C */
 int getVelocity (char *authToken,
@@ -781,10 +781,10 @@

 #define CrossFiniteDiff8(dx, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) 14.0f / 35.0f / dx / dx * (x13 + x15 - x14 - x16) - 1.0f / 20.0f / dx / dx * (x9 + x11 - x10 - x12) + 2.0f / 315.0f / dx / dx * (x5 + x7 - x6 - x8) - 1.0f / 2240.0f / dx / dx * (x1 + x3 - x2 - x4)

-#endif
+#endif//CUTOUT_SUPPORT

 #ifdef  __cplusplus
 }
-#endif
-
-#endif
+#endif//__cplusplus
+
+#endif//TURBLIB_H_


typo not caught with DEBUG=1

typo not caught with DEBUG=1

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@16218 c7de825b-a66e-492c-adef-691d508d4ae1

--- src/tests/recovery_fileops_stress.c
+++ src/tests/recovery_fileops_stress.c
@@ -127,7 +127,6 @@
 //    if ( verbose ) printf("%s : %s : DB '%d', state '%d, rval '%d'\n", __FILE__, __FUNCTION__, i, state, rval);

     int next_state = state;
-    int r;

     char fname[100];
     sprintf(fname, "%s%d.db", table, i);
@@ -137,7 +136,7 @@
         case CREATED:
             do_close(db, fname, &next_state);
             db_array[i] = db = 0;
-            if ( r < (percent_do_op / 2) ) {
+            if ( rval < (percent_do_op / 2) ) {
                 do_delete(fname, &next_state);
             }
             break;


Bugzilla bug 313196: include the minimal headers.

--- security/nss/lib/freebl/alghmac.c
+++ security/nss/lib/freebl/alghmac.c
@@ -35,7 +35,9 @@
  * ***** END LICENSE BLOCK ***** */

 #include "secport.h"
-#include "blapi.h"
+#include "hasht.h"
+#include "blapit.h"
+#include "alghmac.h"
 #include "secerr.h"

 #define HMAC_PAD_SIZE HASH_BLOCK_LENGTH_MAX


offscreen: Remove declarations of long gone cogl_offscreen_{ref,unref}()

Reviewed-by: Robert Bragg <12e9293ec6b30c7fa8a0926af42807e929c1684f@linux.intel.com>

--- cogl/cogl-offscreen.h
+++ cogl/cogl-offscreen.h
@@ -82,36 +82,6 @@
 CoglBool
 cogl_is_offscreen (void *object);

-#ifndef COGL_DISABLE_DEPRECATED
-
-/**
- * cogl_offscreen_ref:
- * @offscreen: A pointer to a #CoglOffscreen framebuffer
- *
- * Increments the reference count on the @offscreen framebuffer.
- *
- * Return value: (transfer none): For convenience it returns the
- *                                given @offscreen
- *
- * Deprecated: 1.2: cogl_object_ref() should be used in new code.
- */
-void *
-cogl_offscreen_ref (void *offscreen) G_GNUC_DEPRECATED;
-
-/**
- * cogl_offscreen_unref:
- * @offscreen: A pointer to a #CoglOffscreen framebuffer
- *
- * Decreases the reference count for the @offscreen buffer and frees it when
- * the count reaches 0.
- *
- * Deprecated: 1.2: cogl_object_unref() should be used in new code.
- */
-void
-cogl_offscreen_unref (void *offscreen) G_GNUC_DEPRECATED;
-
-#endif /* COGL_DISABLE_DEPRECATED */
-
 G_END_DECLS

 #endif /* __COGL_OFFSCREEN_H__ */


Add scroll wheel support.

Add scroll wheel support.

--- src/vte.c
+++ src/vte.c
@@ -6258,6 +6258,31 @@
 	return TRUE;
 }

+static gboolean
+vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event)
+{
+	GtkAdjustment *adj;
+	gdouble new_value;
+
+	adj = VTE_TERMINAL (widget)->adjustment;
+
+	switch (event->direction) {
+	case GDK_SCROLL_UP:
+		new_value = adj->value - adj->page_increment / 2;
+		break;
+	case GDK_SCROLL_DOWN:
+		new_value = adj->value + adj->page_increment / 2;
+		break;
+	default:
+		return FALSE;
+	}
+
+	new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
+	gtk_adjustment_set_value (adj, new_value);
+
+	return TRUE;
+}
+
 /* Initialize methods. */
 static void
 vte_terminal_class_init(VteTerminalClass *klass, gconstpointer data)
@@ -6271,6 +6296,7 @@
 	/* Override some of the default handlers. */
 	gobject_class->finalize = vte_terminal_finalize;
 	widget_class->realize = vte_terminal_realize;
+	widget_class->scroll_event = vte_terminal_scroll;
 	widget_class->expose_event = vte_terminal_expose;
 	widget_class->key_press_event = vte_terminal_key_press;
 	widget_class->button_press_event = vte_terminal_button_press;
@@ -6281,6 +6307,7 @@
 	widget_class->unrealize = vte_terminal_unrealize;
 	widget_class->size_request = vte_terminal_size_request;
 	widget_class->size_allocate = vte_terminal_size_allocate;
+
 	klass->eof_signal =
 		g_signal_new("eof",
 			     G_OBJECT_CLASS_TYPE(klass),


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

--- MagickCore/statistic.c
+++ MagickCore/statistic.c
@@ -1455,9 +1455,9 @@
           continue;
         if ((traits & UpdatePixelTrait) == 0)
           continue;
-        M00[channel]+=QuantumScale*p[i];
-        M10[channel]+=x*QuantumScale*p[i];
-        M01[channel]+=y*QuantumScale*p[i];
+        M00[channel]+=256.0*QuantumScale*p[i];
+        M10[channel]+=x*256.0*QuantumScale*p[i];
+        M01[channel]+=y*256.0*QuantumScale*p[i];
       }
       p+=GetPixelChannels(image);
     }
@@ -1505,21 +1505,22 @@
         if ((traits & UpdatePixelTrait) == 0)
           continue;
         M11[channel]+=(x-centroid[channel].x)*(y-centroid[channel].y)*
-          QuantumScale*p[i];
+          256.0*QuantumScale*p[i];
         M20[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)*
-          QuantumScale*p[i];
+          256.0*QuantumScale*p[i];
         M02[channel]+=(y-centroid[channel].y)*(y-centroid[channel].y)*
-          QuantumScale*p[i];
+          256.0*QuantumScale*p[i];
         M21[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)*
-          (y-centroid[channel].y)*QuantumScale*p[i];
+          (y-centroid[channel].y)*256.0*QuantumScale*p[i];
         M12[channel]+=(x-centroid[channel].x)*(y-centroid[channel].y)*
-          (y-centroid[channel].y)*QuantumScale*p[i];
+          (y-centroid[channel].y)*256.0*QuantumScale*p[i];
         M22[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)*
-          (y-centroid[channel].y)*(y-centroid[channel].y)*QuantumScale*p[i];
+          (y-centroid[channel].y)*(y-centroid[channel].y)*256.0*QuantumScale*
+          p[i];
         M30[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)*
-          (x-centroid[channel].x)*QuantumScale*p[i];
+          (x-centroid[channel].x)*256.0*QuantumScale*p[i];
         M03[channel]+=(y-centroid[channel].y)*(y-centroid[channel].y)*
-          (y-centroid[channel].y)*QuantumScale*p[i];
+          (y-centroid[channel].y)*256.0*QuantumScale*p[i];
       }
       p+=GetPixelChannels(image);
     }
@@ -1543,7 +1544,7 @@
     channel_moments[channel].ellipse_eccentricity=sqrt(1.0-(
       channel_moments[channel].ellipse_axis.y/
       channel_moments[channel].ellipse_axis.x));
-    channel_moments[channel].ellipse_intensity=QuantumRange*M00[channel]/
+    channel_moments[channel].ellipse_intensity=M00[channel]/
       (MagickPI*channel_moments[channel].ellipse_axis.x*
       channel_moments[channel].ellipse_axis.y);
   }


After having tried everything, this seem to work even better

--- quilt/db.c
+++ quilt/db.c
@@ -185,7 +185,7 @@
 		}
 		else
 		{
-			rankflags = 1|32;
+			rankflags = 32;
 			t = appendf(t, &qbuflen, ", ts_rank_cd(\"i\".\"index_%s\", \"query\", %d) AS \"rank\"", query->lang, rankflags);
 		}
 	}


Cache current geometry group to avoid updating buffers if nothing changes

--- gthree/gthreerenderer.c
+++ gthree/gthreerenderer.c
@@ -50,6 +50,10 @@
   GthreeProgram *current_program;
   GthreeMaterial *current_material;
   GthreeCamera *current_camera;
+
+  GthreeBuffer *current_geometry_group_buffer;
+  GthreeProgram *current_geometry_group_program;
+  gboolean current_geometry_group_wireframe;

   GPtrArray *opaque_objects; /* GthreeObjectBuffer */
   GPtrArray *transparent_objects; /* GthreeObjectBuffer */
@@ -1214,33 +1218,37 @@
                GthreeMaterial *material,
                GthreeObjectBuffer *object_buffer)
 {
+  GthreeRendererPrivate *priv = gthree_renderer_get_instance_private (renderer);
   GthreeBuffer *buffer = object_buffer->buffer;
   GthreeObject *object = object_buffer->object;
   GthreeProgram *program = set_program (renderer, camera, lights, fog, material, object);
   //var linewidth, a, attribute, i, il;
   //var attributes = program.attributes;
-  gboolean updateBuffers = false;
+  gboolean update_buffers = false;
   gint position_location, color_location, uv_location, uv2_location, normal_location;
-  //guint32 wireframeBit = gthree_material_get_is_wireframe (material) ? 1 : 0;
-  //guint32 geometryGroupHash = (guint32)buffer + (guint32)program * 2 + wireframeBit;
+  gboolean wireframe = gthree_material_get_is_wireframe (material);

   if (!gthree_material_get_is_visible (material))
     return;

-  if (TRUE /* geometryGroupHash !== _currentGeometryGroupHash */)
-    {
-      //_currentGeometryGroupHash = geometryGroupHash;
-      updateBuffers = true;
-    }
-
-  if (updateBuffers)
+  if (buffer != priv->current_geometry_group_buffer ||
+      program != priv->current_geometry_group_program ||
+      wireframe != priv->current_geometry_group_wireframe)
+    {
+      priv->current_geometry_group_buffer = buffer;
+      priv->current_geometry_group_program = program;
+      priv->current_geometry_group_wireframe = wireframe;
+      update_buffers = true;
+    }
+
+  if (update_buffers)
     init_attributes (renderer);

   // vertices
   position_location = gthree_program_lookup_attribute_location (program, "position");
   if (/*!material.morphTargets && */ position_location >= 0)
     {
-      if (updateBuffers)
+      if (update_buffers)
         {
           glBindBuffer (GL_ARRAY_BUFFER, buffer->vertex_buffer);
           enable_attribute (renderer, position_location);
@@ -1255,7 +1263,7 @@
       */
     }

-  if (updateBuffers)
+  if (update_buffers)
     {
       // custom attributes
       // Use the per-geometryGroup custom attribute arrays which are setup in initMeshBuffers
@@ -1332,25 +1340,25 @@
 #endif

       disable_unused_attributes (renderer);
-
-      // render mesh
-      if (TRUE /* object instanceof THREE.Mesh */ )
-        {
-          if (gthree_material_get_is_wireframe (material))
-            {
-              // wireframe
-              set_line_width (renderer, gthree_material_get_wireframe_line_width (material));
-              if (updateBuffers)
-                glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, buffer->line_buffer);
-              glDrawElements (GL_LINES, buffer->line_count, GL_UNSIGNED_SHORT, 0 );
-            }
-          else
-            {
-              // triangles
-              if (updateBuffers)
-                glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, buffer->face_buffer);
-              glDrawElements (GL_TRIANGLES, buffer->face_count, GL_UNSIGNED_SHORT, 0 );
-            }
+    }
+
+  // render mesh
+  if (TRUE /* object instanceof THREE.Mesh */ )
+    {
+      if (wireframe)
+        {
+          // wireframe
+          set_line_width (renderer, gthree_material_get_wireframe_line_width (material));
+          if (update_buffers)
+            glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, buffer->line_buffer);
+          glDrawElements (GL_LINES, buffer->line_count, GL_UNSIGNED_SHORT, 0 );
+        }
+      else
+        {
+          // triangles
+          if (update_buffers)
+            glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, buffer->face_buffer);
+          glDrawElements (GL_TRIANGLES, buffer->face_count, GL_UNSIGNED_SHORT, 0 );
         }
     }
 }
@@ -1437,6 +1445,9 @@
   priv->current_material = NULL;
   priv->current_camera = NULL;
   priv->lights_need_update = TRUE;
+  priv->current_geometry_group_buffer = NULL;
+  priv->current_geometry_group_program = NULL;
+  priv->current_geometry_group_wireframe = FALSE;

   /* update scene graph */


Uncomment second IPC hook for about:profiler

If this causes ASAN problems with browser tests, then
I'll revert it.

Tests to watch out for (on ASAN bot) are:

IncognitoSplitMode
TwoExtensionsCrashBothAtOnce
TwoExtensionsOneByOne
AutoUpdate
CognitoNoFile
IncognitoNoFile
OnChangedNotificationsBetweenBackgroundPages
SplitModeIncognito

r=rtenneti
BUG=103830
Review URL: http://codereview.chromium.org/8540015

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@109721 0039d316-1c4b-4281-b951-d872f2087c98

--- ipc/ipc_message_macros.h
+++ ipc/ipc_message_macros.h
@@ -973,7 +973,7 @@

 #define IPC_REPLY_HANDLER(func)                                                \
     case IPC_REPLY_ID: {                                                       \
-        /* TRACK_RUN_IN_IPC_HANDLER(func);   TODO(jar) */                      \
+        TRACK_RUN_IN_IPC_HANDLER(func);                                        \
         func(ipc_message__);                                                   \
       }                                                                        \
       break;


Move deprecated stuff to the end

Move deprecated stuff to the end

--- src/vte.h
+++ src/vte.h
@@ -23,10 +23,6 @@
 #include <gio/gio.h>
 #include <pango/pango.h>
 #include <gtk/gtk.h>
-
-#ifndef VTE_DISABLE_DEPRECATED
-#include <sys/types.h> /* for pid_t */
-#endif

 #define __VTE_VTE_H_INSIDE__ 1

@@ -272,20 +268,6 @@
 void vte_terminal_watch_child (VteTerminal *terminal,
                                GPid child_pid);

-#ifndef VTE_DISABLE_DEPRECATED
-pid_t vte_terminal_fork_command(VteTerminal *terminal,
-				const char *command, char **argv,
-				char **envv, const char *working_directory,
-				gboolean lastlog,
-				gboolean utmp,
-				gboolean wtmp) G_GNUC_DEPRECATED;
-pid_t vte_terminal_forkpty(VteTerminal *terminal,
-			   char **envv, const char *working_directory,
-			   gboolean lastlog,
-			   gboolean utmp,
-			   gboolean wtmp) G_GNUC_DEPRECATED;
-#endif /* VTE_DISABLE_DEPRECATED */
-
 gboolean vte_terminal_fork_command_full(VteTerminal *terminal,
                                         VtePtyFlags pty_flags,
                                         const char *working_directory,
@@ -465,16 +447,6 @@
 /* Get the contents of the status line. */
 const char *vte_terminal_get_status_line(VteTerminal *terminal);

-#ifndef VTE_DISABLE_DEPRECATED
-/* Get the padding the widget is using. */
-void vte_terminal_get_padding(VteTerminal *terminal, int *xpad, int *ypad) G_GNUC_DEPRECATED;
-#endif
-
-#ifndef VTE_DISABLE_DEPRECATED
-void vte_terminal_set_pty(VteTerminal *terminal, int pty_master);
-int vte_terminal_get_pty(VteTerminal *terminal);
-#endif
-
 void vte_terminal_set_pty_object(VteTerminal *terminal, VtePty *pty);
 VtePty *vte_terminal_get_pty_object(VteTerminal *terminal);

@@ -511,6 +483,10 @@

 #ifndef VTE_DISABLE_DEPRECATED
+
+G_END_DECLS
+#include <sys/types.h> /* for pid_t */
+G_BEGIN_DECLS

 /**
  * VTE_IS_TERMINAL_ERASE_BINDING:
@@ -562,6 +538,20 @@
 void vte_terminal_set_font_from_string_full(VteTerminal *terminal,
 					    const char *name,
 					    VteTerminalAntiAlias antialias) G_GNUC_DEPRECATED;
+pid_t vte_terminal_fork_command(VteTerminal *terminal,
+				const char *command, char **argv,
+				char **envv, const char *working_directory,
+				gboolean lastlog,
+				gboolean utmp,
+				gboolean wtmp) G_GNUC_DEPRECATED;
+pid_t vte_terminal_forkpty(VteTerminal *terminal,
+			   char **envv, const char *working_directory,
+			   gboolean lastlog,
+			   gboolean utmp,
+			   gboolean wtmp) G_GNUC_DEPRECATED;
+void vte_terminal_get_padding(VteTerminal *terminal, int *xpad, int *ypad) G_GNUC_DEPRECATED;
+void vte_terminal_set_pty(VteTerminal *terminal, int pty_master);
+int vte_terminal_get_pty(VteTerminal *terminal);

 #endif /* VTE_DISABLE_DEPRECATED */


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

--- MagickWand/operation.c
+++ MagickWand/operation.c
@@ -4209,7 +4209,7 @@

           swap_index=(-1);
           flags=ParseGeometry(arg1,&geometry_info);
-          if ((flags & RhoValue) != 0)
+          if ((flags & RhoValue) == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           index=(ssize_t) geometry_info.rho;
           if ((flags & SigmaValue) != 0)


Rename MODE_* consts to TYPE_*

Rename MODE_* consts to TYPE_*

The "mode" nomenclature is only used when opening a stream to tell the decoder which types of packets should be decoded, which is an ored combination of the desired types. Everywhere else, the code only checks for distinct types, and the MODE_ names seemed confusing.

--- Aurio/Aurio.FFmpeg.Proxy32/proxy.c
+++ Aurio/Aurio.FFmpeg.Proxy32/proxy.c
@@ -76,7 +76,7 @@
  * and most importantly to run several decoders in parallel.
  */
 typedef struct ProxyInstance {
-	int					mode;
+	int					mode; // contains the desired packet types to decode
 	AVFormatContext		*fmt_ctx;
 	AVStream			*audio_stream;
 	AVStream			*video_stream;
@@ -119,9 +119,9 @@
 	}					video_output;
 } ProxyInstance;

-#define MODE_NONE  0x00
-#define MODE_AUDIO 0x01
-#define MODE_VIDEO 0x02
+#define TYPE_NONE  0x00
+#define TYPE_AUDIO 0x01
+#define TYPE_VIDEO 0x02

 // function definitions
 EXPORT ProxyInstance *stream_open_file(int mode, char *filename);
@@ -187,7 +187,7 @@

 	const int stream_mode = 1; // 0 =  file, 1 = buffered stream IO
 	FILE *f = NULL; // used for buffered stream IO
-	int mode = MODE_AUDIO | MODE_VIDEO;
+	int mode = TYPE_AUDIO | TYPE_VIDEO;

 	if (argc < 2) {
 		fprintf(stderr, "No source file specified\n");
@@ -208,14 +208,14 @@

 	//info(pi->fmt_ctx);

-	if (mode & MODE_AUDIO) {
+	if (mode & TYPE_AUDIO) {
 		printf("audio length: %lld, frame size: %d\n", pi->audio_output.length, pi->audio_output.frame_size);
 		printf("audio format (samplerate/samplesize/channels): %d/%d/%d\n",
 			pi->audio_output.format.sample_rate, pi->audio_output.format.sample_size, pi->audio_output.format.channels);

 		audio_output_buffer_size = pi->audio_output.frame_size * pi->audio_output.format.channels * pi->audio_output.format.sample_size;
 	}
-	if (mode & MODE_VIDEO) {
+	if (mode & TYPE_VIDEO) {
 		printf("video length: %lld, frame size: %d\n", pi->video_output.length, pi->video_output.frame_size);
 		printf("video format (width/height/fps/aspect): %d/%d/%f/%f\n",
 			pi->video_output.format.width, pi->video_output.format.height, pi->video_output.format.frame_rate, pi->video_output.format.aspect_ratio);
@@ -229,7 +229,7 @@
 	int64_t count1 = 0, last_ts1;
 	while ((ret = stream_read_frame(pi, &timestamp, output_buffer, output_buffer_size, &frame_type, &video_frame_props)) >= 0) {
 		printf("read %d @ %lld type %d\n", ret, timestamp, frame_type);
-		if (frame_type == MODE_VIDEO) {
+		if (frame_type == TYPE_VIDEO) {
 			printf("keyframe %d, pict_type %d, interlaced %d, top_field_first %d\n",
 				video_frame_props->keyframe, video_frame_props->pict_type, video_frame_props->interlaced, video_frame_props->top_field_first);
 		}
@@ -336,7 +336,7 @@
 {
 	int ret;

-	if (pi->mode == MODE_NONE) {
+	if (pi->mode == TYPE_NONE) {
 		fprintf(stderr, "no mode specified");
 		exit(1);
 	}
@@ -355,7 +355,7 @@

 	//info(pi->fmt_ctx);

-	if (pi->mode & MODE_AUDIO) {
+	if (pi->mode & TYPE_AUDIO) {
 		// open audio stream
 		if ((ret = open_codec_context(pi->fmt_ctx, AVMEDIA_TYPE_AUDIO)) < 0) {
 			fprintf(stderr, "Cannot find audio stream\n");
@@ -422,7 +422,7 @@
 		}
 	}

-	if (pi->mode & MODE_VIDEO) {
+	if (pi->mode & TYPE_VIDEO) {
 		// open audio stream
 		if ((ret = open_codec_context(pi->fmt_ctx, AVMEDIA_TYPE_VIDEO)) < 0) {
 			fprintf(stderr, "Cannot find video stream\n");
@@ -500,7 +500,7 @@
 	int cached = 0;

 	*got_frame = 0;
-	*frame_type = MODE_NONE;
+	*frame_type = TYPE_NONE;

 	// if packet is empty, read new packet from stream
 	if (pi->pkt.size == 0) {
@@ -512,16 +512,16 @@
 		}
 	}

-	if (pi->mode & MODE_AUDIO) {
+	if (pi->mode & TYPE_AUDIO) {
 		ret = decode_audio_packet(pi, got_frame, cached);
 		if (*got_frame) {
-			*frame_type = MODE_AUDIO;
-		}
-	}
-	if (!*got_frame && pi->mode & MODE_VIDEO) {
+			*frame_type = TYPE_AUDIO;
+		}
+	}
+	if (!*got_frame && pi->mode & TYPE_VIDEO) {
 		ret = decode_video_packet(pi, got_frame, cached);
 		if (*got_frame) {
-			*frame_type = MODE_VIDEO;
+			*frame_type = TYPE_VIDEO;
 		}
 	}

@@ -538,11 +538,11 @@
 	pi->pkt.data += ret;
 	pi->pkt.size -= ret;

-	if (*frame_type == MODE_AUDIO && convert_audio_samples(pi) < 0) {
+	if (*frame_type == TYPE_AUDIO && convert_audio_samples(pi) < 0) {
 		av_free_packet(&pi->pkt);
 		return -1; // conversion failed, signal EOF
 	}
-	else if (*frame_type == MODE_VIDEO && convert_video_frame(pi) < 0) {
+	else if (*frame_type == TYPE_VIDEO && convert_video_frame(pi) < 0) {
 		av_free_packet(&pi->pkt);
 		return -1; // conversion failed, signal EOF
 	}
@@ -579,11 +579,11 @@
 		pi->output_buffer_size = output_buffer_size;
 		ret = stream_read_frame_any(pi, &got_frame, frame_type);
 		if (ret < 0 || got_frame) {
-			if (*frame_type == MODE_AUDIO) {
+			if (*frame_type == TYPE_AUDIO) {
 				*timestamp = pi->pkt.pts != AV_NOPTS_VALUE ?
 					pts_to_samples(pi, pi->audio_stream->time_base, pi->pkt.pts) : pi->pkt.pos;
 			}
-			else if (*frame_type == MODE_VIDEO) {
+			else if (*frame_type == TYPE_VIDEO) {
 				*timestamp = pi->pkt.pts != AV_NOPTS_VALUE ?
 					pts_to_samples(pi, pi->video_stream->time_base, pi->pkt.pts) : pi->pkt.pos;
 				pi->video_output.current_frame.keyframe = pi->frame->key_frame;


wav: check for block align overflow [bug #279]

The block align value depends on the encoding and number of channels.
Do the calculation in 32 bits, then check for 16-bit overflow.

--- src/wav.c
+++ src/wav.c
@@ -1362,7 +1362,7 @@
     uint16_t wChannels;           /* number of channels */
     uint32_t dwSamplesPerSecond;  /* samples per second per channel*/
     uint32_t dwAvgBytesPerSec=0;  /* estimate of bytes per second needed */
-    uint16_t wBlockAlign=0;       /* byte alignment of a basic sample block */
+    uint32_t wBlockAlign=0;       /* byte alignment of a basic sample block */
     uint16_t wBitsPerSample=0;    /* bits per sample */
     /* fmt chunk extension (not PCM) */
     uint16_t wExtSize=0;          /* extra bytes in the format extension */
@@ -1457,6 +1457,13 @@
         default:
                 break;
     }
+
+    if (wBlockAlign > UINT16_MAX) {
+        lsx_fail_errno(ft, SOX_EOF, "Too many channels (%u)",
+                       ft->signal.channels);
+        return SOX_EOF;
+    }
+
     wav->formatTag = wFormatTag;
     wav->blockAlign = wBlockAlign;
     wav->samplesPerBlock = wSamplesPerBlock;


typo

typo

[r21090]

--- ir/be/ia32/bearch_ia32.c
+++ ir/be/ia32/bearch_ia32.c
@@ -977,7 +977,7 @@
 			break;
 #endif

-		default: panic("Invalid tansformer");
+		default: panic("Invalid transformer");
 	}

 	/* do local optimizations (mainly CSE) */


Simplify a bit scale factor computation by using helpers.

--- src/video_output/vout_subpictures.c
+++ src/video_output/vout_subpictures.c
@@ -653,6 +653,40 @@
     p_region->i_align |= SUBPICTURE_RENDERED;
 }

+/* */
+typedef struct
+{
+    int w;
+    int h;
+} spu_scale_t;
+
+static spu_scale_t spu_scale_create( int w, int h )
+{
+    spu_scale_t s = { .w = w, .h = h };
+    if( s.w <= 0 )
+        s.w = SCALE_UNIT;
+    if( s.h <= 0 )
+        s.h = SCALE_UNIT;
+    return s;
+}
+static spu_scale_t spu_scale_unit(void)
+{
+    return spu_scale_create( SCALE_UNIT, SCALE_UNIT );
+}
+static spu_scale_t spu_scale_createq( int wn, int wd, int hn, int hd )
+{
+    return spu_scale_create( wn * SCALE_UNIT / wd,
+                             hn * SCALE_UNIT / hd );
+}
+static int spu_scale_w( int v, const spu_scale_t s )
+{
+    return v * s.w / SCALE_UNIT;
+}
+static int spu_scale_h( int v, const spu_scale_t s )
+{
+    return v * s.h / SCALE_UNIT;
+}
+
 /**
  * Place a region
  */
@@ -660,10 +694,10 @@
                             const video_format_t *p_fmt,
                             const subpicture_t *p_subpic,
                             const subpicture_region_t *p_region,
-                            int i_inv_scale_x, int i_inv_scale_y )
-{
-    int i_delta_x = p_region->i_x * i_inv_scale_x / SCALE_UNIT;
-    int i_delta_y = p_region->i_y * i_inv_scale_y / SCALE_UNIT;
+                            const spu_scale_t scale_inv )
+{
+    int i_delta_x = spu_scale_w( p_region->i_x, scale_inv );
+    int i_delta_y = spu_scale_h( p_region->i_y, scale_inv );
     int i_x, i_y;

     if( p_region->i_align & SUBPICTURE_ALIGN_TOP )
@@ -705,9 +739,8 @@
 static void SpuRenderRegion( spu_t *p_spu,
                              picture_t *p_pic_dst,
                              subpicture_t *p_subpic, subpicture_region_t *p_region,
-                             const int i_scale_width_orig, const int i_scale_height_orig,
-                             const int pi_scale_width[SCALE_SIZE],
-                             const int pi_scale_height[SCALE_SIZE],
+                             const spu_scale_t scale_org,
+                             const spu_scale_t p_scale_size[SCALE_SIZE],
                              const video_format_t *p_fmt )
 {
     video_format_t fmt_original;
@@ -716,9 +749,8 @@
     int i_fade_alpha;
     int i_x_offset;
     int i_y_offset;
-    int i_scale_idx;
-    int i_inv_scale_x;
-    int i_inv_scale_y;
+    spu_scale_t scale_inv;
+    spu_scale_t scale_size;
     filter_t *p_scale;

     vlc_assert_locked( &p_spu->subpicture_lock );
@@ -727,7 +759,7 @@
     b_rerender_text = false;
     if( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') )
     {
-        SpuRenderText( p_spu, &b_rerender_text, p_subpic, p_region, __MIN(i_scale_width_orig, i_scale_height_orig) );
+        SpuRenderText( p_spu, &b_rerender_text, p_subpic, p_region, __MIN( scale_org.w, scale_org.h ) );
         b_restore_format = b_rerender_text;

         /* Check if the rendering has failed ... */
@@ -738,15 +770,13 @@
     if( p_region->i_align & SUBPICTURE_RENDERED )
     {
         /* We are using a region which come from rendered text */
-        i_scale_idx   = SCALE_TEXT;
-        i_inv_scale_x = i_scale_width_orig;
-        i_inv_scale_y = i_scale_height_orig;
+        scale_inv  = scale_org;
+        scale_size = p_scale_size[SCALE_TEXT];
     }
     else
     {
-        i_scale_idx   = SCALE_DEFAULT;
-        i_inv_scale_x = SCALE_UNIT;
-        i_inv_scale_y = SCALE_UNIT;
+        scale_inv   = spu_scale_unit();
+        scale_size = p_scale_size[SCALE_DEFAULT];
     }

     /* Force palette if requested
@@ -773,12 +803,12 @@
         p_scale = p_spu->p_scale;

     if( p_scale &&
-        ( ( pi_scale_width[i_scale_idx]  > 0 && pi_scale_width[i_scale_idx]  != SCALE_UNIT ) ||
-          ( pi_scale_height[i_scale_idx] > 0 && pi_scale_height[i_scale_idx] != SCALE_UNIT ) ||
+        ( ( scale_size.w > 0 && scale_size.w != SCALE_UNIT ) ||
+          ( scale_size.h > 0 && scale_size.h != SCALE_UNIT ) ||
           ( b_force_palette ) ) )
     {
-        const unsigned i_dst_width  = p_region->fmt.i_width  * pi_scale_width[i_scale_idx] / SCALE_UNIT;
-        const unsigned i_dst_height = p_region->fmt.i_height * pi_scale_height[i_scale_idx] / SCALE_UNIT;
+        const unsigned i_dst_width  = spu_scale_w( p_region->fmt.i_width, scale_size );
+        const unsigned i_dst_height = spu_scale_h( p_region->fmt.i_height, scale_size );

         /* Destroy if cache is unusable */
         if( p_region->p_cache )
@@ -817,13 +847,13 @@
             p_scale->fmt_out.video.i_height = i_dst_height;

             p_scale->fmt_out.video.i_visible_width =
-                p_region->fmt.i_visible_width * pi_scale_width[ i_scale_idx ] / SCALE_UNIT;
+                spu_scale_w( p_region->fmt.i_visible_width, scale_size );
             p_scale->fmt_out.video.i_visible_height =
-                p_region->fmt.i_visible_height * pi_scale_height[ i_scale_idx ] / SCALE_UNIT;
+                spu_scale_h( p_region->fmt.i_visible_height, scale_size );

             p_region->p_cache->fmt = p_scale->fmt_out.video;
-            p_region->p_cache->i_x = p_region->i_x * pi_scale_width[ i_scale_idx ] / SCALE_UNIT;
-            p_region->p_cache->i_y = p_region->i_y * pi_scale_height[ i_scale_idx ] / SCALE_UNIT;
+            p_region->p_cache->i_x = spu_scale_w( p_region->i_x, scale_size );
+            p_region->p_cache->i_y = spu_scale_h( p_region->i_y, scale_size );
             p_region->p_cache->i_align = p_region->i_align;
             p_region->p_cache->i_alpha = p_region->i_alpha;

@@ -857,12 +887,12 @@
     /* */
     SpuRegionPlace( &i_x_offset, &i_y_offset,
                     p_fmt, p_subpic, p_region,
-                    i_inv_scale_x, i_inv_scale_y );
+                    scale_inv );

     if( p_spu->i_margin != 0 && !b_force_crop )
     {
         int i_diff = 0;
-        int i_low = (i_y_offset - p_spu->i_margin) * i_inv_scale_y / SCALE_UNIT;
+        int i_low = spu_scale_h( i_y_offset - p_spu->i_margin, scale_inv );
         int i_high = i_low + p_region->fmt.i_height;

         /* crop extra margin to keep within bounds */
@@ -870,21 +900,17 @@
             i_diff = i_low;
         if( i_high > (int)p_fmt->i_height )
             i_diff = i_high - p_fmt->i_height;
-        i_y_offset -= ( p_spu->i_margin * i_inv_scale_y / SCALE_UNIT + i_diff );
+        i_y_offset -= spu_scale_h( p_spu->i_margin, scale_inv ) + i_diff;
     }

     /* Force cropping if requested */
     if( b_force_crop )
     {
         video_format_t *p_fmt = &p_region->fmt;
-        int i_crop_x = p_spu->i_crop_x * pi_scale_width[ i_scale_idx ] / SCALE_UNIT
-                            * i_inv_scale_x / SCALE_UNIT;
-        int i_crop_y = p_spu->i_crop_y * pi_scale_height[ i_scale_idx ] / SCALE_UNIT
-                            * i_inv_scale_y / SCALE_UNIT;
-        int i_crop_width = p_spu->i_crop_width * pi_scale_width[ i_scale_idx ] / SCALE_UNIT
-                            * i_inv_scale_x / SCALE_UNIT;
-        int i_crop_height = p_spu->i_crop_height * pi_scale_height[ i_scale_idx ] / SCALE_UNIT
-                            * i_inv_scale_y / SCALE_UNIT;
+        int i_crop_x = spu_scale_w( spu_scale_w( p_spu->i_crop_x, scale_size ), scale_inv );
+        int i_crop_y = spu_scale_h( spu_scale_h( p_spu->i_crop_y, scale_size ), scale_inv );
+        int i_crop_width = spu_scale_w( spu_scale_w( p_spu->i_crop_width, scale_size ), scale_inv );
+        int i_crop_height= spu_scale_h( spu_scale_h( p_spu->i_crop_height,scale_size ), scale_inv );

         /* Find the intersection */
         if( i_crop_x + i_crop_width <= i_x_offset ||
@@ -974,17 +1000,15 @@
     int i_source_video_width;
     int i_source_video_height;
     subpicture_t *p_subpic;
+    spu_scale_t scale_size_org;

     /* Get lock */
     vlc_mutex_lock( &p_spu->subpicture_lock );

-    if( i_scale_width_orig <= 0 )
-        i_scale_width_orig = SCALE_UNIT;
-    if( i_scale_height_orig <= 0 )
-        i_scale_height_orig = SCALE_UNIT;
-
-    i_source_video_width  = p_fmt->i_width  * SCALE_UNIT / i_scale_width_orig;
-    i_source_video_height = p_fmt->i_height * SCALE_UNIT / i_scale_height_orig;
+    scale_size_org = spu_scale_create( i_scale_width_orig, i_scale_height_orig );
+
+    i_source_video_width  = p_fmt->i_width  * SCALE_UNIT / scale_size_org.w;
+    i_source_video_height = p_fmt->i_height * SCALE_UNIT / scale_size_org.h;

     /* Check i_status again to make sure spudec hasn't destroyed the subpic */
     for( p_subpic = p_subpic_list;
@@ -995,12 +1019,12 @@
          * the video then disregard all further references to the subtitle
          * stream.
          */
-        if( ( i_source_video_height == p_subpic->i_original_picture_height ) &&
-            ( i_source_video_width  == p_subpic->i_original_picture_width ) )
+        if( i_source_video_height == p_subpic->i_original_picture_height &&
+            i_source_video_width  == p_subpic->i_original_picture_width )
         {
             /* FIXME this looks wrong */
+            p_subpic->i_original_picture_width  = 0;
             p_subpic->i_original_picture_height = 0;
-            p_subpic->i_original_picture_width = 0;
         }

         /* */
@@ -1043,8 +1067,7 @@
                 p_subpic = p_subpic->p_next )
     {
         subpicture_region_t *p_region;
-        int pi_scale_width[ SCALE_SIZE ];
-        int pi_scale_height[ SCALE_SIZE ];
+        spu_scale_t p_scale_size[SCALE_SIZE];
         int k;

         if( !p_subpic->p_region )
@@ -1095,16 +1118,15 @@

             /* XXX for text:
              *  scale[] allows to pass from rendered size (by text module) to video output size */
-            pi_scale_width[SCALE_TEXT] = p_fmt->i_width * SCALE_UNIT /
-                                          p_spu->p_text->fmt_out.video.i_width;
-            pi_scale_height[SCALE_TEXT]= p_fmt->i_height * SCALE_UNIT /
-                                          p_spu->p_text->fmt_out.video.i_height;
+
+            p_scale_size[SCALE_TEXT] =
+                spu_scale_createq( p_fmt->i_width,  p_spu->p_text->fmt_out.video.i_width,
+                                   p_fmt->i_height, p_spu->p_text->fmt_out.video.i_height );
         }
         else
         {
             /* Just set a value to avoid using invalid memory while looping over the array */
-            pi_scale_width[SCALE_TEXT] =
-            pi_scale_height[SCALE_TEXT]= SCALE_UNIT;
+            p_scale_size[SCALE_TEXT] = spu_scale_unit();
         }

         /* XXX for default:
@@ -1112,13 +1134,14 @@
         if( p_subpic->i_original_picture_height > 0 &&
             p_subpic->i_original_picture_width  > 0 )
         {
-            pi_scale_width[SCALE_DEFAULT]  = p_fmt->i_width  * SCALE_UNIT / p_subpic->i_original_picture_width;
-            pi_scale_height[SCALE_DEFAULT] = p_fmt->i_height * SCALE_UNIT / p_subpic->i_original_picture_height;
+            p_scale_size[SCALE_DEFAULT] =
+                spu_scale_createq( p_fmt->i_width,  p_subpic->i_original_picture_width,
+                                   p_fmt->i_height, p_subpic->i_original_picture_height );
         }
         else
         {
-            pi_scale_width[ SCALE_DEFAULT ]  = i_scale_width_orig;
-            pi_scale_height[ SCALE_DEFAULT ] = i_scale_height_orig;
+
+            p_scale_size[SCALE_DEFAULT] = scale_size_org;
         }

         for( k = 0; k < SCALE_SIZE ; k++ )
@@ -1130,10 +1153,8 @@
             if( p_subpic->i_original_picture_height > 0 &&
                 p_subpic->i_original_picture_width <= 0 )
             {
-                pi_scale_height[ k ] = pi_scale_height[ k ] * i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-                pi_scale_width[ k ]  = pi_scale_width[ k ]  * i_source_video_height /
-                                 p_subpic->i_original_picture_height;
+                p_scale_size[k].h = p_scale_size[k].h * i_source_video_height / p_subpic->i_original_picture_height;
+                p_scale_size[k].w = p_scale_size[k].w * i_source_video_height / p_subpic->i_original_picture_height;
             }
         }

@@ -1162,7 +1183,7 @@
             /* FIXME FIXME what about region->i_x/i_y ? */
             for( k = 0; k < SCALE_SIZE; k++ )
             {
-                pi_scale_width[k] = pi_scale_width[k] *
+                p_scale_size[k].w = p_scale_size[k].w *
                     (int64_t)p_region->fmt.i_sar_num * p_fmt->i_sar_den /
                     p_region->fmt.i_sar_den / p_fmt->i_sar_num;
             }
@@ -1170,10 +1191,8 @@

         /* Render all regions */
         for( ; p_region != NULL; p_region = p_region->p_next )
-            SpuRenderRegion( p_spu, p_pic_dst,
-                             p_subpic, p_region, i_scale_width_orig, i_scale_height_orig,
-                             pi_scale_width, pi_scale_height,
-                             p_fmt );
+            SpuRenderRegion( p_spu, p_pic_dst, p_subpic, p_region,
+                             scale_size_org, p_scale_size, p_fmt );
     }

     vlc_mutex_unlock( &p_spu->subpicture_lock );


scrolledwindow: Don't use LIGHTEN operator

For the overshoot gradient, using OVER is fine. Simplifies the code and
increases performance.

--- gtk/gtkscrolledwindow.c
+++ gtk/gtkscrolledwindow.c
@@ -1639,9 +1639,6 @@
   if (!_gtk_scrolled_window_get_overshoot (scrolled_window, &overshoot_x, &overshoot_y))
     return;

-  cairo_push_group (cr);
-  cairo_set_operator (cr, CAIRO_OPERATOR_LIGHTEN);
-
   gtk_scrolled_window_relative_allocation (widget, &relative_allocation);

   context = gtk_widget_get_style_context (widget);
@@ -1706,9 +1703,6 @@

       cairo_pattern_destroy (pattern);
     }
-
-  cairo_pop_group_to_source (cr);
-  cairo_paint (cr);
 }

 static gboolean


Add support for Album and Track tags in RIFF files

Add support for Album and Track tags in RIFF files in the LIST chunk of WAV
files as per other formats. Patch by Joel Bouchat <bouchat@hotmail.com>
against libsndfile 1.0.24, forward-ported by Richard Ash

Signed-off-by: Erik de Castro Lopo <1586a8e151fb6d548e7a343b9bcdfea42e83ffc0@mega-nerd.com>

--- src/wav.c
+++ src/wav.c
@@ -104,6 +104,7 @@
 #define ISBJ_MARKER		(MAKE_MARKER ('I', 'S', 'B', 'J'))
 #define ICMT_MARKER		(MAKE_MARKER ('I', 'C', 'M', 'T'))
 #define IAUT_MARKER		(MAKE_MARKER ('I', 'A', 'U', 'T'))
+#define ITRK_MARKER		(MAKE_MARKER ('I', 'T', 'R', 'K'))

 /* Weird WAVPACK marker which can show up at the start of the DATA section. */
 #define wvpk_MARKER (MAKE_MARKER ('w', 'v', 'p', 'k'))
@@ -1253,6 +1254,14 @@
 				psf_binheader_writef (psf, "ms", IGNR_MARKER, psf->strings.storage + psf->strings.data [k].offset) ;
 				break ;

+			case SF_STR_ALBUM :
+				psf_binheader_writef (psf, "ms", IPRD_MARKER, psf->strings.storage + psf->strings.data [k].offset) ;
+				break ;
+
+			case SF_STR_TRACKNUMBER :
+				psf_binheader_writef (psf, "ms", ITRK_MARKER, psf->strings.storage + psf->strings.data [k].offset) ;
+				break ;
+
 			default :
 				break ;
 			} ;
@@ -1384,6 +1393,7 @@
 			case ISBJ_MARKER :
 			case ISRC_MARKER :
 			case IAUT_MARKER :
+			case ITRK_MARKER :
 					bytesread += psf_binheader_readf (psf, "4", &dword) ;
 					dword += (dword & 1) ;
 					if (dword >= SIGNED_SIZEOF (buffer))
@@ -1476,6 +1486,12 @@
 					break ;
 			case IGNR_MARKER :
 					psf_store_string (psf, SF_STR_GENRE, buffer) ;
+					break ;
+			case IPRD_MARKER :
+					psf_store_string (psf, SF_STR_ALBUM, buffer) ;
+					break ;
+			case ITRK_MARKER :
+					psf_store_string (psf, SF_STR_TRACKNUMBER, buffer) ;
 					break ;
 			} ;
 		} ;


Formatting

Formatting

--- typedef.c
+++ typedef.c
@@ -71,7 +71,7 @@
  *	in the creation of the content, though an attribution to the author
  *	is not necessary.
  *
- *	Paul Hsieh exposition license
+ *  Paul Hsieh exposition license
  *
  *	The content of all text, figures, tables and displayed layout is
  *	copyrighted by its author and owner Paul Hsieh unless specifically
@@ -96,9 +96,9 @@
  * Unalligned loads are faster if we can do them, otherwise fall back
  * to safer version below.
  */
-#	define load16(D) (*((const uint16_t*)(D)))
+#   define load16(D) (*((const uint16_t*)(D)))
 #else
-#	define load16(D) ((((uint32_t)(((const uint8_t*)(D))[1])) << 8) + \
+#   define load16(D) ((((uint32_t)(((const uint8_t*)(D))[1])) << 8) + \
                         (uint32_t)(((const uint8_t*)(D))[0]))
 #endif
 unsigned int inline typedef_hash(const char *data) {


fix pointer type to class entry

fix pointer type to class entry

--- zookeeper_client_exceptions.c
+++ zookeeper_client_exceptions.c
@@ -69,11 +69,11 @@

 void throw_domain_exception(char *message, int code TSRMLS_DC)
 {
-    zend_class_entry **domain_exception_class_entry = NULL;
+    zend_class_entry **domain_exception_class_entry_pp = NULL;
     char *domain_exception_class_name = "domainexception";

-    domain_exception_class_entry = zend_hash_str_find_ptr(CG(class_table), ZEND_STRL(domain_exception_class_name));
-    zend_throw_exception(domain_exception_class_entry, message, code TSRMLS_CC);
+    domain_exception_class_entry_pp = (zend_class_entry **)zend_hash_str_find_ptr(CG(class_table), ZEND_STRL(domain_exception_class_name));
+    zend_throw_exception(*domain_exception_class_entry_pp, message, code TSRMLS_CC);
 }

 /*


make do_error_all_cases static

make do_error_all_cases static

git-svn-id: 4b2652e19d8125fd9d24eff55f31fd1beb5a42e7@1550 c7de825b-a66e-492c-adef-691d508d4ae1

--- src/ydb.c
+++ src/ydb.c
@@ -66,7 +66,7 @@
 // If errfile is set, print to the errfile: prefix, fmt string, maybe include the stderr string.
 // Both errcall and errfile may be called.
 // If errfile is not set and errcall is not set, the use stderr as the errfile.
-void do_error_all_cases(const DB_ENV * env, int error, int include_stderrstring, int use_stderr_if_nothing_else, const char *fmt, va_list ap) {
+static void do_error_all_cases(const DB_ENV * env, int error, int include_stderrstring, int use_stderr_if_nothing_else, const char *fmt, va_list ap) {
     if (env->i->errcall) {
 	// errcall gets prefix sent separately
 	// the error message is the printf message, maybe followed by ": " and the dbstrerror (if include_stderrstring is set)


[change] to separate udmabuf_device_probe()/udmabuf_device_remove() from udmabuf_platform_driver_probe()/udmabuf_platform_driver_remove()

--- udmabuf.c
+++ udmabuf.c
@@ -67,7 +67,7 @@
 MODULE_AUTHOR("ikwzm");
 MODULE_LICENSE("Dual BSD/GPL");

-#define DRIVER_VERSION     "1.4.3-rc5"
+#define DRIVER_VERSION     "1.4.3-rc6"
 #define DRIVER_NAME        "udmabuf"
 #define DEVICE_NAME_FORMAT "udmabuf%d"
 #define DEVICE_MAX_NUM      256
@@ -1271,25 +1271,22 @@
     }
 }

-
-/**
- * DOC: Udmabuf Platform Driver
- *
- * This section defines the udmabuf platform driver.
- *
- * * udmabuf_platform_driver_probe()   - Probe call for the device.
- * * udmabuf_platform_driver_remove()  - Remove call for the device.
- * * udmabuf_of_match                  - Open Firmware Device Identifier Matching Table.
- * * udmabuf_platform_driver           - Platform Driver Structure.
- */
-
-/**
- * udmabuf_platform_driver_cleanup()   - Clean Up udmabuf platform driver
- * @pdev:       handle to the platform device structure.
+/**
+ * DOC: Udmabuf Device Driver
+ *
+ * This section defines the udmabuf device driver.
+ *
+ * * udmabuf_device_probe()   - Probe  call for the device driver.
+ * * udmabuf_device_remove()  - Remove call for the device driver.
+ */
+
+/**
+ * udmabuf_device_remove()   - Remove udmabuf device driver.
+ * @dev:        handle to the device structure.
  * @devdata     Pointer to the udmabuf device data structure.
  * Return:      Success(=0) or error status(<0).
  */
-static int udmabuf_platform_driver_cleanup(struct platform_device *pdev, struct udmabuf_device_data *devdata)
+static int udmabuf_device_remove(struct device *dev, struct udmabuf_device_data *devdata)
 {
     int retval = 0;

@@ -1298,10 +1295,10 @@
         bool of_reserved_mem = devdata->of_reserved_mem;
 #endif
         retval = udmabuf_device_destroy(devdata);
-        dev_set_drvdata(&pdev->dev, NULL);
+        dev_set_drvdata(dev, NULL);
 #if (USE_OF_RESERVED_MEM == 1)
         if (of_reserved_mem) {
-            of_reserved_mem_device_release(&pdev->dev);
+            of_reserved_mem_device_release(dev);
         }
 #endif
     } else {
@@ -1311,13 +1308,13 @@
 }

 /**
- * udmabuf_platform_driver_probe() -  Probe call for the device.
- * @pdev:       handle to the platform device structure.
+ * udmabuf_device_probe() -  Probe call for the device.
+ * @dev:        handle to the device structure.
  * Return:      Success(=0) or error status(<0).
  *
  * It does all the memory allocation and registration for the device.
  */
-static int udmabuf_platform_driver_probe(struct platform_device *pdev)
+static int udmabuf_device_probe(struct device *dev)
 {
     int                         retval       = 0;
     int                         prop_status  = 0;
@@ -1327,25 +1324,24 @@
     struct udmabuf_device_data* device_data  = NULL;
     const char*                 device_name  = NULL;

-    dev_dbg(&pdev->dev, "driver probe start.\n");
     /*
      * size property
      */
-    if        ((prop_status = udmabuf_device_read_size_property(&pdev->dev,   &u32_value)) == 0) {
+    if        ((prop_status = udmabuf_device_read_size_property(dev    , &u32_value)) == 0) {
         size = u32_value;
-    } else if ((prop_status = of_property_read_u32(pdev->dev.of_node, "size", &u32_value)) == 0) {
+    } else if ((prop_status = of_property_read_u32(dev->of_node, "size", &u32_value)) == 0) {
         size = u32_value;
     } else {
-        dev_err(&pdev->dev, "invalid property size. status=%d\n", prop_status);
+        dev_err(dev, "invalid property size. status=%d\n", prop_status);
         retval = -ENODEV;
         goto failed;
     }
     /*
      * minor-number property
      */
-    if        (udmabuf_device_read_minor_number_property(&pdev->dev  , &u32_value) == 0) {
+    if        (udmabuf_device_read_minor_number_property(dev    , &u32_value) == 0) {
         minor_number = u32_value;
-    } else if (of_property_read_u32(pdev->dev.of_node, "minor-number", &u32_value) == 0) {
+    } else if (of_property_read_u32(dev->of_node, "minor-number", &u32_value) == 0) {
         minor_number = u32_value;
     } else {
         minor_number = -1;
@@ -1353,12 +1349,12 @@
     /*
      * devic-name property
      */
-    prop_status = device_property_read_string(&pdev->dev, "device-name", &device_name);
+    prop_status = device_property_read_string(dev , "device-name", &device_name);
     if (prop_status != 0) {
-        device_name = of_get_property(pdev->dev.of_node , "device-name", NULL);
+        device_name = of_get_property(dev->of_node, "device-name", NULL);
         if (IS_ERR_OR_NULL(device_name)) {
             if (minor_number < 0)
-                device_name = dev_name(&pdev->dev);
+                device_name = dev_name(dev);
             else
                 device_name = NULL;
         }
@@ -1366,15 +1362,15 @@
     /*
      * udmabuf_device_create()
      */
-    device_data = udmabuf_device_create(device_name, &pdev->dev, minor_number);
+    device_data = udmabuf_device_create(device_name, dev, minor_number);
     if (IS_ERR_OR_NULL(device_data)) {
         retval = PTR_ERR(device_data);
-        dev_err(&pdev->dev, "driver create failed. return=%d.\n", retval);
+        dev_err(dev, "driver create failed. return=%d.\n", retval);
         device_data = NULL;
         retval = (retval == 0) ? -EINVAL : retval;
         goto failed;
     }
-    dev_set_drvdata(&pdev->dev, device_data);
+    dev_set_drvdata(dev, device_data);
     /*
      * set size
      */
@@ -1383,12 +1379,12 @@
      * of_reserved_mem_device_init()
      */
 #if (USE_OF_RESERVED_MEM == 1)
-    if (pdev->dev.of_node != NULL) {
-        retval = of_reserved_mem_device_init(&pdev->dev);
+    if (dev->of_node != NULL) {
+        retval = of_reserved_mem_device_init(dev);
         if (retval == 0) {
             device_data->of_reserved_mem = 1;
         } else if (retval != -ENODEV) {
-            dev_err(&pdev->dev, "of_reserved_mem_device_init failed. return=%d\n", retval);
+            dev_err(dev, "of_reserved_mem_device_init failed. return=%d\n", retval);
             goto failed;
         }
     }
@@ -1410,25 +1406,25 @@
     {
 #if (LINUX_VERSION_CODE >= 0x040C00)
 #if (LINUX_VERSION_CODE >= 0x041200)
-        retval = of_dma_configure(&pdev->dev, pdev->dev.of_node, true);
+        retval = of_dma_configure(dev, dev->of_node, true);
 #else
-        retval = of_dma_configure(&pdev->dev, pdev->dev.of_node);
+        retval = of_dma_configure(dev, dev->of_node);
 #endif
         if (retval != 0) {
-            dev_err(&pdev->dev, "of_dma_configure failed. return=%d\n", retval);
+            dev_err(dev, "of_dma_configure failed. return=%d\n", retval);
             goto failed;
         }
 #else
-        of_dma_configure(&pdev->dev, pdev->dev.of_node);
+        of_dma_configure(dev, dev->of_node);
 #endif
     }
 #endif
     /*
      * sync-mode property
      */
-    if (of_property_read_u32(pdev->dev.of_node, "sync-mode", &u32_value) == 0) {
+    if (of_property_read_u32(dev->of_node, "sync-mode", &u32_value) == 0) {
         if ((u32_value < SYNC_MODE_MIN) || (u32_value > SYNC_MODE_MAX)) {
-            dev_err(&pdev->dev, "invalid sync-mode property value=%d\n", u32_value);
+            dev_err(dev, "invalid sync-mode property value=%d\n", u32_value);
             goto failed;
         }
         device_data->sync_mode &= ~SYNC_MODE_MASK;
@@ -1437,15 +1433,15 @@
     /*
      * sync-always property
      */
-    if (of_property_read_bool(pdev->dev.of_node, "sync-always")) {
+    if (of_property_read_bool(dev->of_node, "sync-always")) {
         device_data->sync_mode |= SYNC_ALWAYS;
     }
     /*
      * sync-direction property
      */
-    if (of_property_read_u32(pdev->dev.of_node, "sync-direction", &u32_value) == 0) {
+    if (of_property_read_u32(dev->of_node, "sync-direction", &u32_value) == 0) {
         if (u32_value > 2) {
-            dev_err(&pdev->dev, "invalid sync-direction property value=%d\n", u32_value);
+            dev_err(dev, "invalid sync-direction property value=%d\n", u32_value);
             goto failed;
         }
         device_data->sync_direction = (int)u32_value;
@@ -1453,9 +1449,9 @@
     /*
      * sync-offset property
      */
-    if (of_property_read_u32(pdev->dev.of_node, "sync-offset", &u32_value) == 0) {
+    if (of_property_read_u32(dev->of_node, "sync-offset", &u32_value) == 0) {
         if (u32_value >= device_data->size) {
-            dev_err(&pdev->dev, "invalid sync-offset property value=%d\n", u32_value);
+            dev_err(dev, "invalid sync-offset property value=%d\n", u32_value);
             goto failed;
         }
         device_data->sync_offset = (int)u32_value;
@@ -1463,9 +1459,9 @@
     /*
      * sync-size property
      */
-    if (of_property_read_u32(pdev->dev.of_node, "sync-size", &u32_value) == 0) {
+    if (of_property_read_u32(dev->of_node, "sync-size", &u32_value) == 0) {
         if (device_data->sync_offset + u32_value > device_data->size) {
-            dev_err(&pdev->dev, "invalid sync-size property value=%d\n", u32_value);
+            dev_err(dev, "invalid sync-size property value=%d\n", u32_value);
             goto failed;
         }
         device_data->sync_size = (size_t)u32_value;
@@ -1477,22 +1473,53 @@
      */
     retval = udmabuf_device_setup(device_data);
     if (retval) {
-        dev_err(&pdev->dev, "driver setup failed. return=%d\n", retval);
+        dev_err(dev, "driver setup failed. return=%d\n", retval);
         goto failed;
     }

     if (info_enable) {
         udmabuf_device_info(device_data);
+    }
+
+    return 0;
+
+failed:
+    udmabuf_device_remove(dev, device_data);
+
+    return retval;
+}
+
+/**
+ * DOC: Udmabuf Platform Driver
+ *
+ * This section defines the udmabuf platform driver.
+ *
+ * * udmabuf_platform_driver_probe()   - Probe call for the device.
+ * * udmabuf_platform_driver_remove()  - Remove call for the device.
+ * * udmabuf_of_match                  - Open Firmware Device Identifier Matching Table.
+ * * udmabuf_platform_driver           - Platform Driver Structure.
+ */
+
+/**
+ * udmabuf_platform_driver_probe() -  Probe call for the device.
+ * @pdev:       Handle to the platform device structure.
+ * Return:      Success(=0) or error status(<0).
+ *
+ * It does all the memory allocation and registration for the device.
+ */
+static int udmabuf_platform_driver_probe(struct platform_device *pdev)
+{
+    int retval = 0;
+
+    dev_dbg(&pdev->dev, "driver probe start.\n");
+
+    retval = udmabuf_device_probe(&pdev->dev);
+
+    if (info_enable) {
         dev_info(&pdev->dev, "driver installed.\n");
     }
-    return 0;
-
-failed:
-    udmabuf_platform_driver_cleanup(pdev, device_data);
-
     return retval;
 }
-
 /**
  * udmabuf_platform_driver_remove() -  Remove call for the device.
  * @pdev:       Handle to the platform device structure.
@@ -1507,7 +1534,7 @@

     dev_dbg(&pdev->dev, "driver remove start.\n");

-    retval = udmabuf_platform_driver_cleanup(pdev, this);
+    retval = udmabuf_device_remove(&pdev->dev, this);

     if (info_enable) {
         dev_info(&pdev->dev, "driver removed.\n");


remove prototype for deleted SRP function

--- ssl/ssl.h
+++ ssl/ssl.h
@@ -1811,8 +1811,6 @@
 					  int (*cb)(SSL *,void *));
 int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,
 				      int (*cb)(SSL *,int *,void *));
-int SSL_CTX_set_srp_missing_srp_username_callback(SSL_CTX *ctx,
-						  char *(*cb)(SSL *,void *));
 int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);

 int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,


[change] to use vm_insert_pfn() in mmap page fault handler, according to suggest of issue #22

--- udmabuf.c
+++ udmabuf.c
@@ -66,7 +66,7 @@
 MODULE_AUTHOR("ikwzm");
 MODULE_LICENSE("Dual BSD/GPL");

-#define DRIVER_VERSION     "1.4.1"
+#define DRIVER_VERSION     "1.4.2-rc1"
 #define DRIVER_NAME        "udmabuf"
 #define DEVICE_NAME_FORMAT "udmabuf%d"
 #define DEVICE_MAX_NUM      256
@@ -457,39 +457,43 @@
 static inline int _udmabuf_device_vma_fault(struct vm_area_struct* vma, struct vm_fault* vmf)
 {
     struct udmabuf_device_data* this = vma->vm_private_data;
-    struct page*  page_ptr           = NULL;
     unsigned long offset             = vmf->pgoff << PAGE_SHIFT;
     unsigned long phys_addr          = this->phys_addr + offset;
     unsigned long page_frame_num     = phys_addr  >> PAGE_SHIFT;
     unsigned long request_size       = 1          << PAGE_SHIFT;
     unsigned long available_size     = this->alloc_size -offset;
+    unsigned long virt_addr;

 #if (LINUX_VERSION_CODE >= 0x040A00)
+    virt_addr = vmf->address;
+#else
+    virt_addr = (unsigned long)vmf->virtual_address;
+#endif
+
     if (UDMABUF_DEBUG_CHECK(this, debug_vma))
         dev_info(this->dma_dev,
-                 "vma_fault(virt_addr=0x%lx, phys_addr=%pad)\n",
-                 vmf->address,
-                 &phys_addr
+                 "vma_fault(virt_addr=%pad, phys_addr=%pad)\n", &virt_addr, &phys_addr
         );
-#else
-    if (UDMABUF_DEBUG_CHECK(this, debug_vma))
-        dev_info(this->dma_dev,
-                 "vma_fault(virt_addr=0x%lx, phys_addr=%pad)\n",
-                 (long unsigned int)vmf->virtual_address,
-                 &phys_addr
-        );
-#endif
-
+
     if (request_size > available_size)
         return VM_FAULT_SIGBUS;

     if (!pfn_valid(page_frame_num))
         return VM_FAULT_SIGBUS;

-    page_ptr = pfn_to_page(page_frame_num);
-    get_page(page_ptr);
-    vmf->page = page_ptr;
-    return 0;
+#if (LINUX_VERSION_CODE >= 0x041200)
+    return vmf_insert_pfn(vma, virt_addr, page_frame_num);
+#else
+    {
+        int err = vm_insert_pfn(vma, virt_addr, page_frame_num);
+	if (err == -ENOMEM)
+		return VM_FAULT_OOM;
+	if (err < 0 && err != -EBUSY)
+		return VM_FAULT_SIGBUS;
+
+	return VM_FAULT_NOPAGE;
+    }
+#endif
 }

 #if (LINUX_VERSION_CODE >= 0x040B00)
@@ -629,7 +633,8 @@
     {
         unsigned long page_frame_num = (this->phys_addr >> PAGE_SHIFT) + vma->vm_pgoff;
         if (pfn_valid(page_frame_num)) {
-            vma->vm_ops = &udmabuf_device_vm_ops;
+            vma->vm_flags |= VM_PFNMAP;
+            vma->vm_ops    = &udmabuf_device_vm_ops;
             udmabuf_device_vma_open(vma);
             return 0;
         }


Refilter is required after setting visible column

--- gtk/tests/filtermodel.c
+++ gtk/tests/filtermodel.c
@@ -145,6 +145,7 @@
 filter_test_enable_filter (FilterTest *fixture)
 {
   gtk_tree_model_filter_set_visible_column (fixture->filter, 1);
+  gtk_tree_model_filter_refilter (fixture->filter);
 }

 static void


DOC: comments

DOC: comments

--- common/vtkCellArray.h
+++ common/vtkCellArray.h
@@ -91,7 +91,7 @@
   int InsertNextCell(int npts, int* pts);
   int InsertNextCell(vtkIdList &pts);

-  //this and next two methods work together
+  // this and next two methods work together
   int InsertNextCell(int npts);
   void InsertCellPoint(int id);
   void UpdateCellCount(int npts);


derecho_bw_test works

derecho_bw_test works

--- sst/sst.h
+++ sst/sst.h
@@ -210,7 +210,6 @@
               res_vec(num_members),
               thread_start(params.start_predicate_thread) {
         std::cout << "Here in SST constructor" << std::endl;
-	return;

         //Figure out my SST index
         for(uint32_t i = 0; i < num_members; ++i) {
@@ -248,6 +247,10 @@
             char* write_addr, *read_addr;
             write_addr = const_cast<char*>(rows) + rowLen * sst_index;
             read_addr = const_cast<char*>(rows) + rowLen * my_index;
+	    std::cout << "rows: " << rows << std::endl;
+	    std::cout << "rowLen: " << rowLen << std::endl;
+	    std::cout << "write_addr: " << write_addr << std::endl;
+	    std::cout << "read_addr: " << read_addr << std::endl;
             if(sst_index != my_index) {
                 if(row_is_frozen[sst_index]) {
                     continue;


Some improvements of station searching.

Some improvements of station searching.

--- src/windows/search_station_window.c
+++ src/windows/search_station_window.c
@@ -32,7 +32,6 @@
 #endif

 // Searching
-static bool s_is_searching;
 static char s_search_string[SELECTION_LAYER_CELL_COUNT+1] = {0};

 typedef struct SearchStationResult {
@@ -120,7 +119,8 @@
 }

 static void selection_handle_did_change(int index, bool is_forward, void *context) {
-    if (s_search_results_index != index - 1 && s_search_string[index - 1] != '\0') {
+    if (index == 0 ||                           // Reset to beginning
+        s_search_string[index - 1] != '\0') {   // Fast forward to end, no need to reload
         s_search_results_index = index - 1;
         if (is_forward) {
             size_t *search_results = (size_t *)&s_search_results[s_search_results_index].search_results;
@@ -156,15 +156,11 @@
 // MARK: Menu layer callbacks

 static uint16_t get_num_rows_callback(MenuLayer *menu_layer, uint16_t section_index, void *context) {
-    if (s_is_searching) {
+    size_t return_value = current_search_results_count();
+    if (return_value == 0) {
         return 1;
     } else {
-        size_t return_value = current_search_results_count();
-        if (return_value == 0) {
-            return 1;
-        } else {
-            return return_value;
-        }
+        return return_value;
     }
 }

@@ -192,10 +188,7 @@
     GColor text_color = curr_fg_color();
 #endif

-    if (s_is_searching) {
-        graphics_context_set_text_color(ctx, text_color);
-        draw_cell_title(ctx, cell_layer, "Search...");
-    } else if (current_search_results_count() > 0) {
+    if (current_search_results_count() > 0) {
         size_t station_index = current_search_result_at_index(cell_index->row);

         // Station
@@ -213,7 +206,7 @@
         free(str_station);
     } else {
         graphics_context_set_text_color(ctx, text_color);
-        draw_cell_title(ctx, cell_layer, "Not found.");
+        draw_cell_title(ctx, cell_layer, (s_search_results_index > 0)?"Not found.":"Input a name...");
     }
 }


startup code now calls init.c functions before main and fini.c functions after main

--- startup.c
+++ startup.c
@@ -23,6 +23,9 @@
 #include <stdint.h>
 #include <inc/hw_types.h>
 #include <inc/hw_nvic.h>
+#include <driverlib/rom.h>
+
+#include "compiler.h"

 // Application entry point
 extern int main(void);
@@ -40,16 +43,16 @@
 extern uint32_t _bss;
 extern uint32_t _ebss;
 extern uint32_t _stack_top;
-extern void (*__preinit_array_start[])(void);
-extern void (*__preinit_array_end[])(void);
 extern void (*__init_array_start[])(void);
 extern void (*__init_array_end[])(void);
+extern void (*__fini_array_start[])(void);
+extern void (*__fini_array_end[])(void);

 // Typedef for exception handler function
 typedef void (*nvic_handler_t)(void);

 // NVIC exception table
-__attribute__((section(".nvic_table")))
+__section(".nvic_table")
 nvic_handler_t nvic_table[] = {
     // Stack pointer starts at top of RAM
     // Stack size is defined by linker script
@@ -234,17 +237,7 @@
         *dest++ = 0;
     }

-    // Enable FPU
-    HWREG(NVIC_CPAC) = ((HWREG(NVIC_CPAC) &
-                         ~(NVIC_CPAC_CP10_M | NVIC_CPAC_CP11_M)) |
-                         NVIC_CPAC_CP10_FULL | NVIC_CPAC_CP11_FULL);
-
-    // Global C++ constructors
-    cnt = __preinit_array_end - __preinit_array_start;
-    for(i = 0; i < cnt; i++) {
-        __preinit_array_start[i]();
-    }
-
+    // Call any initializer functions/constructors
     cnt = __init_array_end - __init_array_start;
     for(i = 0; i < cnt; i++) {
         __init_array_start[i]();
@@ -252,6 +245,12 @@

     // Application entry
     main();
+
+    // Call any finalizer functions and destructors
+    cnt = __fini_array_end - __fini_array_start;
+    for(i = 0; i < cnt; i++) {
+        __fini_array_start[i]();
+    }
 }

 // Non-maskable interrupt handler


formal

formal

--- src/zfs-fuse/zfs_operations_slash.c
+++ src/zfs-fuse/zfs_operations_slash.c
@@ -66,7 +66,7 @@
 #include "slashd/mdsio.h"

 kmem_cache_t		*file_info_cache;
-int		 stack_size;
+int			 stack_size;
 static cred_t		 zrootcreds;

 static uint64_t        *immnsIdCache[MAX_FILESYSTEMS];
@@ -79,7 +79,7 @@
 #define	FIDLINK_DIR		(1 << 3)

 /**
- * get_vnode_fids - Get SLASH FID + generation (external) and the
+ * get_vnode_fids - Get SLASH2 FID + generation (external) and the
  *	ZFS/MDSIO layer inum "fid" (internal) for a vnode.
  */
 static __inline void
@@ -714,7 +714,7 @@
 }

 /*
- * XXX replace finfop with something meaningful for slash d_ino cache
+ * XXX replace finfop with something meaningful for SLASH2 d_ino cache
  */
 int
 zfsslash2_opendir(int vfsid, mdsio_fid_t ino, const struct slash_creds *slcrp,
@@ -753,7 +753,7 @@
 			goto out;
 	}

-	/* XXX convert to the slash d_ino cache */
+	/* XXX convert to the SLASH2 d_ino cache */
 	file_info_t *finfo = kmem_cache_alloc(file_info_cache, KM_NOSLEEP);
 	if (finfo == NULL) {
 		error = ENOMEM;
@@ -775,7 +775,7 @@
 }

 /*
- * XXX convert to the slash d_ino cache .. same as above
+ * XXX convert to the SLASH2 d_ino cache .. same as above
  */
 int
 zfsslash2_release(int vfsid, __unusedx const struct slash_creds *slcrp,
@@ -1088,7 +1088,7 @@
 #if 0
 		/*
 		 * I have found a place in zfs_mknode() where I can
-		 * write SLASH FID 1 into the root node.  This function
+		 * write SLASH2 FID 1 into the root node.  This function
 		 * is called by dsl_pool_create() twice, once by
 		 * zfs_create_fs(), once by zfs_create_share_dir().
 		 * Both time I see the IS_ROOT_NODE flag is used.  I
@@ -1212,7 +1212,7 @@
  * @finfo: value-result handle to ZFS structure; used as a descriptor to
  *	all other mdsio routines.
  * @logfunc: callback for logging create operation.
- * @getslfid: callback for retrieving a unique SLASH FID.
+ * @getslfid: callback for retrieving a unique SLASH2 FID.
  *
  * Note that ino is the target inode if this is an open; otherwise it is
  * the inode of the parent.


[imcc] remove .endnamespace from preprocessing function in imcc.

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

--- compilers/imcc/main.c
+++ compilers/imcc/main.c
@@ -591,7 +591,6 @@
             case RESULT:        printf(".result "); break;
             case RETURN:        printf(".return "); break;
             case NAMESPACE:     printf(".namespace "); break;
-            case ENDNAMESPACE:  printf(".endnamespace"); break;
             case CONST:         printf(".const "); break;
             case PARAM:         printf(".param "); break;
             /* RT#46147: print out more information about the macro */


Add a tool similar to hexdump, but for text files.

error: pathspec 'strdump.c' did not match any file(s) known to git

--- strdump.c
+++ strdump.c
@@ -0,0 +1,91 @@
+/* strdump.c -- similar to hexdump but with ascii strings */
+
+#include <stdio.h>
+#include <string.h>
+
+int
+strdump(FILE *fo, FILE *fi)
+{
+    int c, n;
+
+    n = 0;
+    fputs("\"", fo);
+    c = fgetc(fi);
+    while (c != -1)
+    {
+	if (c == '\n' || c == '\r')
+	    fputs("\\n\"\n\"", fo);
+	else
+	    putc(c, fo);
+	c = fgetc(fi);
+	n ++;
+    }
+    fputs("\"\n", fo);
+    return n;
+}
+
+
+int
+main(int argc, char **argv)
+{
+    FILE *fo;
+    FILE *fi;
+    char name[256];
+    char *realname;
+    char *p;
+    int i, len;
+
+    if (argc < 3)
+    {
+	fprintf(stderr, "usage: hexdump output.c input.dat\n");
+	return 1;
+    }
+
+    fo = fopen(argv[1], "wb");
+    if (!fo)
+    {
+	fprintf(stderr, "hexdump: could not open output file\n");
+	return 1;
+    }
+
+    for (i = 2; i < argc; i++)
+    {
+	fi = fopen(argv[i], "rb");
+	if (!fi)
+	{
+	    fprintf(stderr, "hexdump: could not open input file\n");
+	    return 1;
+	}
+
+	realname = strrchr(argv[i], '/');
+	if (!realname)
+	    realname = strrchr(argv[i], '\\');
+	if (realname)
+	    realname ++;
+	else
+	    realname = argv[i];
+
+	strcpy(name, argv[i]);
+	p = name;
+	while (*p)
+	{
+	    if ((*p == '/') || (*p == '.') || (*p == '\\') || (*p == '-'))
+		*p = '_';
+	    p ++;
+	}
+
+	fprintf(fo, "const char %s_name[] = \"%s\";\n", name, realname);
+	fprintf(fo, "const char %s_buf[] = {\n", name);
+
+	len = strdump(fo, fi);
+
+	fprintf(fo, "};\n");
+	fprintf(fo, "const int %s_len = %d;\n", name, len);
+	fprintf(fo, "\n");
+
+	fclose(fi);
+    }
+
+    return 0;
+}
+


Added reset() and docs.

Added reset() and docs.

--- uspeech.h
+++ uspeech.h
@@ -64,7 +64,8 @@
 public:
     int f,e,o,s,h,v; /*!< Accumulators for the stated characters */
     syllable(); /*!< Constructor for the class*/
-    void classify(char c); /*!< Classifies the character into a vector so as to create a fingerprint for the uttered syllable*/
+    void reset(); /*!< Resets the accumulator so a new syllable can be formed. Call this when you detect silence*/
+    void classify(char c);
     int* tointptr(); /*!< Returns the vector from the accumulators as an integer pointer */
     #if ARDUINO_ENVIRONMENT > 0
     void debugPrint(); /*!< Outputs the datain the accumulator vector. Only enabled for arduino.*/


GM memory leak patch (Michael Brodeur)

GM memory leak patch (Michael Brodeur)

--- util/gm.c
+++ util/gm.c
@@ -127,6 +127,7 @@

 void crGmSend( CRConnection *conn, void **bufp,
 		void *start, unsigned int len );
+void crGmFree( CRConnection *conn, void *buf );

 #if CR_GM_DEBUG || CR_GM_CREDITS_DEBUG

@@ -679,6 +680,7 @@
 		unsigned int len )
 {
 	CRGmBuffer *temp;
+	CRMessageType cached_type;

 #ifdef CHROMIUM_THREADSAFE
 	crLockMutex(&cr_gm.read_mutex);
@@ -717,12 +719,27 @@
 		}
 		temp->len = len;
 		memcpy( temp+1, msg, len );
+		cached_type = msg->header.type;

 		cr_gm_provide_receive_buffer( msg );

 		if (!cr_gm.recv( gm_conn->conn, temp+1, len ))
 		{
 			crNetDefaultRecv( gm_conn->conn, temp+1, len );
+		}
+
+		switch( cached_type )
+		{
+		case CR_MESSAGE_FLOW_CONTROL: /* Handled by InstantReclaim */
+		case CR_MESSAGE_MULTI_BODY:	/* Handled by InstantReclaim */
+		case CR_MESSAGE_MULTI_TAIL:	/* Handled by InstantReclaim */
+		case CR_MESSAGE_OPCODES:	/* Handled in crserver/server_stream.c */
+		case CR_MESSAGE_OOB:		/* The programmer's problem (according to humper in util/tcpip.c) */
+			break;
+
+		default:
+			crGmFree( gm_conn->conn, temp+1 );
+			break
 		}
 	}
 	else


SNC fixes from Mike Kasprzak. new.h -> new

--- utility.h
+++ utility.h
@@ -2,7 +2,7 @@
 #define RDESTL_UTILITY_H

 #include "rdestl_common.h"
-#include <new.h>
+#include <new>

 namespace rde
 {


Added check for negative offset for PyBuffer_FromObject and check for negative size for PyBuffer_FromMemory.  Greg Stein.

--- Objects/bufferobject.c
+++ Objects/bufferobject.c
@@ -55,6 +55,12 @@
 {
 	PyBufferObject * b;

+	if ( size < 0 ) {
+		PyErr_SetString(PyExc_ValueError,
+				"size must be zero or positive");
+		return NULL;
+	}
+
 	b = PyObject_NEW(PyBufferObject, &PyBuffer_Type);
 	if ( b == NULL )
 		return NULL;
@@ -83,6 +89,12 @@
 	void *p;
 	int count;

+	if ( offset < 0 ) {
+		PyErr_SetString(PyExc_ValueError,
+				"offset must be zero or positive");
+		return NULL;
+	}
+
 	if ( (*pb->bf_getsegcount)(base, NULL) != 1 )
 	{
 		PyErr_SetString(PyExc_TypeError, "single-segment buffer object expected");
@@ -92,7 +104,7 @@
 		return NULL;

 	/* apply constraints to the start/end */
-	if ( size == Py_END_OF_BUFFER )
+	if ( size == Py_END_OF_BUFFER || size < 0 )
 		size = count;
 	if ( offset > count )
 		offset = count;


Add garbage collection for module objects.  Closes patch #102939 and fixes bug #126345.

--- Objects/moduleobject.c
+++ Objects/moduleobject.c
@@ -18,6 +18,7 @@
 		return NULL;
 	nameobj = PyString_FromString(name);
 	m->md_dict = PyDict_New();
+	PyObject_GC_Init(m);
 	if (m->md_dict == NULL || nameobj == NULL)
 		goto fail;
 	if (PyDict_SetItemString(m->md_dict, "__name__", nameobj) != 0)
@@ -130,11 +131,12 @@
 static void
 module_dealloc(PyModuleObject *m)
 {
+	PyObject_GC_Fini(m);
 	if (m->md_dict != NULL) {
 		_PyModule_Clear((PyObject *)m);
 		Py_DECREF(m->md_dict);
 	}
-	PyObject_DEL(m);
+	PyObject_DEL(PyObject_AS_GC(m));
 }

 static PyObject *
@@ -211,11 +213,22 @@
 		return PyDict_SetItemString(m->md_dict, name, v);
 }

+/* We only need a traverse function, no clear function: If the module
+   is in a cycle, md_dict will be cleared as well, which will break
+   the cycle. */
+static int
+module_traverse(PyModuleObject *m, visitproc visit, void *arg)
+{
+	if (m->md_dict != NULL)
+		return visit(m->md_dict, arg);
+	return 0;
+}
+
 PyTypeObject PyModule_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,			/*ob_size*/
 	"module",		/*tp_name*/
-	sizeof(PyModuleObject),	/*tp_size*/
+	sizeof(PyModuleObject) + PyGC_HEAD_SIZE,	/*tp_size*/
 	0,			/*tp_itemsize*/
 	(destructor)module_dealloc, /*tp_dealloc*/
 	0,			/*tp_print*/
@@ -223,4 +236,16 @@
 	(setattrfunc)module_setattr, /*tp_setattr*/
 	0,			/*tp_compare*/
 	(reprfunc)module_repr, /*tp_repr*/
+	0,			/*tp_as_number*/
+	0,			/*tp_as_sequence*/
+	0,		/*tp_as_mapping*/
+	0,		/* tp_hash */
+	0,		/* tp_call */
+	0,		/* tp_str */
+	0,		/* tp_getattro */
+	0,		/* tp_setattro */
+	0,		/* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /*tp_flags*/
+	0,		/* tp_doc */
+	(traverseproc)module_traverse,	/* tp_traverse */
 };


Issue 18719: Remove a false optimization

Remove an unused early-out test from the critical path for
dict and set lookups.

When the strings already have matching lengths and hashes,
there is no additional information gained by checking the first
characters (the probability of a mismatch is already known to
be less than 1 in 2**64).

--- Objects/stringobject.c
+++ Objects/stringobject.c
@@ -1255,7 +1255,6 @@
     PyStringObject *a = (PyStringObject*) o1;
     PyStringObject *b = (PyStringObject*) o2;
     return Py_SIZE(a) == Py_SIZE(b)
-      && *a->ob_sval == *b->ob_sval
       && memcmp(a->ob_sval, b->ob_sval, Py_SIZE(a)) == 0;
 }


cube: Fix valgrind warnings

cube: Fix valgrind warnings

--- demos/cube.c
+++ demos/cube.c
@@ -1356,9 +1356,7 @@
         moduleCreateInfo.pCode = code;
         moduleCreateInfo.flags = 0;
         err = vkCreateShaderModule(demo->device, &moduleCreateInfo, pShaderModule);
-        if (err) {
-            free((void *) moduleCreateInfo.pCode);
-        }
+        assert(!err);

         shaderCreateInfo.flags = 0;
         shaderCreateInfo.module = *pShaderModule;
@@ -1388,6 +1386,7 @@
         shaderCreateInfo.pName = "main";
         shaderCreateInfo.stage = stage;
         err = vkCreateShader(demo->device, &shaderCreateInfo, &shader);
+        free((void *) moduleCreateInfo.pCode);
     }
     return shader;
 }
@@ -1418,13 +1417,16 @@
 static VkShader demo_prepare_vs(struct demo *demo)
 {
     if (!demo->use_glsl) {
+        VkShader shader;
         void *vertShaderCode;
         size_t size;

         vertShaderCode = demo_read_spv("cube-vert.spv", &size);

-        return demo_prepare_shader(demo, VK_SHADER_STAGE_VERTEX, &demo->vert_shader_module,
-                                   vertShaderCode, size);
+        shader = demo_prepare_shader(demo, VK_SHADER_STAGE_VERTEX, &demo->vert_shader_module,
+                                     vertShaderCode, size);
+        free(vertShaderCode);
+        return shader;
     } else {
         static const char *vertShaderText =
                 "#version 140\n"
@@ -1458,13 +1460,16 @@
 static VkShader demo_prepare_fs(struct demo *demo)
 {
     if (!demo->use_glsl) {
+        VkShader shader;
         void *fragShaderCode;
         size_t size;

         fragShaderCode = demo_read_spv("cube-frag.spv", &size);

-        return demo_prepare_shader(demo, VK_SHADER_STAGE_FRAGMENT, &demo->frag_shader_module,
-                                   fragShaderCode, size);
+        shader = demo_prepare_shader(demo, VK_SHADER_STAGE_FRAGMENT, &demo->frag_shader_module,
+                                     fragShaderCode, size);
+        free(fragShaderCode);
+        return shader;
     } else {
         static const char *fragShaderText =
                 "#version 140\n"
@@ -1768,6 +1773,8 @@
     }
     free(demo->buffers);

+    free(demo->queue_props);
+
     vkDestroyCommandPool(demo->device, demo->cmd_pool);
     vkDestroyDevice(demo->device);
     if (demo->validate) {
@@ -1778,6 +1785,7 @@
 #ifndef _WIN32
     xcb_destroy_window(demo->connection, demo->window);
     xcb_disconnect(demo->connection);
+    free(demo->atom_wm_delete_window);
 #endif // _WIN32
 }


- remove useless register declaration - remove the use of the volatile keyword, i have no idea what I was   thinking here.

--- subcalc.c
+++ subcalc.c
@@ -126,7 +126,7 @@
 static int
 setaddrmask(struct in6_addr *ip, struct in6_addr *mask, unsigned bits)
 {
-	register int i;
+	int i;

 	*mask = *(plen2mask(bits));
 	for(i = 0; i < sizeof(*ip); i++)
@@ -326,7 +326,7 @@
 static int
 getb(u_char *field, unsigned pos)
 {
-	register int i;
+	int i;
 	u_char mask;

 	mask = 0x80;
@@ -340,7 +340,7 @@
 setb(u_char *field, unsigned pos, char state)
 {
 	u_char mask;
-	register int i;
+	int i;

 	mask = 0x80;
 	for(i = 0; i < (pos % 8); i++)
@@ -383,7 +383,7 @@
 static int
 unsetmask(int af, u_char *adrspace, unsigned b)
 {
-	register int i;
+	int i;
 	union {
 		struct in6_addr *in6;
 		struct in_addr *in;
@@ -408,7 +408,7 @@
 extractbits(int af, u_char *adrspace)
 {
 	unsigned bits;
-	register int i;
+	int i;

 	bits = 0;
 	if (af == AF_INET6) {
@@ -454,7 +454,7 @@
 static int
 setmask(int af, u_char *adrspace, unsigned b)
 {
-	register int i;
+	int i;
 	union {
 		struct in6_addr *in6;
 		struct in_addr *in;
@@ -504,7 +504,7 @@
 int
 main(int argc, char *argv [])
 {
-	volatile struct in_addr adr, adr2;
+	struct in_addr adr, adr2;
 	struct in6_addr adr6, adr62, ip6, ip6mask;
 	int b;
 	double p;


Bumped to 1.0.5, developpement version

Bumped to 1.0.5, developpement version

--- version.h
+++ version.h
@@ -3,6 +3,6 @@

 #define MAJOR 1
 #define MINOR 0
-#define REVISION 4
+#define REVISION 5

 #endif //_GL4ES_VERSION_H


Blockchain: added GetBlockContaining, GetElementAfter and GetElementBefore methods.

--- OrbitCore/BlockChain.h
+++ OrbitCore/BlockChain.h
@@ -206,6 +206,57 @@

         return nullptr;
     }
+
+    Block<T, BlockSize>* GetBlockContaining(const T* a_Element)
+    {
+        Block<T, BlockSize>* block = m_Root;
+        while (block)
+        {
+            int size = block->m_Size;
+            if (size)
+            {
+                T* begin = &block->m_Data[0];
+                T* end = &block->m_Data[size-1];
+                if (begin <= a_Element && end >= a_Element)
+                {
+                    return block;
+                }
+            }
+            block = block->m_Next;
+        }
+
+        return nullptr;
+    }
+
+    T* GetElementAfter(const T* a_Element)
+    {
+        auto block = GetBlockContaining(a_Element);
+        if (block)
+        {
+            T* begin = &block->m_Data[0];
+            size_t index = a_Element - begin;
+            if (index < block->m_Size - 1)
+                return &block->m_Data[++index];
+            else if (block->m_Next && block->m_Next->m_Size)
+                return &block->m_Next->m_Data[0];
+        }
+        return nullptr;
+    }
+
+    T* GetElementBefore(const T* a_Element)
+    {
+        auto block = GetBlockContaining(a_Element);
+        if (block)
+        {
+            T* begin = &block->m_Data[0];
+            size_t index = a_Element - begin;
+            if (index > 0)
+                return &block->m_Data[--index];
+            else if (block->m_Prev)
+                return &block->m_Prev->m_Data[block->m_Prev->m_Size-1];
+        }
+        return nullptr;
+    }

     BlockIterator<T, BlockSize> begin(){ return BlockIterator<T, BlockSize>(m_Root); }
     BlockIterator<T, BlockSize> end(){ return BlockIterator<T, BlockSize>(nullptr); }


ipmi: rename waiting_msgs to waiting_rcv_msgs

To avoid confusion with the coming transmit message queue.

Signed-off-by: Corey Minyard <97c9634d4bed2779ee3e53c0495565ccc28c2363@mvista.com>


amd64_edac: add MCA error types

amd64_edac: add MCA error types

Borislav:
- cleanup comments

Reviewed-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>
Signed-off-by: Doug Thompson <35920ba1a7821e73308e9ec6cecac34ddd29c0c4@xmission.com>
Signed-off-by: Borislav Petkov <2b4cb5acba6b5321acd37371d9b73a646c388783@amd.com>

error: pathspec 'drivers/edac/amd64_edac_err_types.c' did not match any file(s) known to git


drm/atomic-helper: debug output for modesets

With the combination of ->enable and ->active it's a bit complicated
to follow what exactly is going on sometimes within a full modeset.
Add debug output to make this all traceable.

Reviewed-by: Thierry Reding <3055038c414aef68bf32c33b8118623e7554e0f2@nvidia.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@intel.com>


drm/i915: add i915_pc8_status debugfs file

Make it print the value of the variables on the PC8 struct.

v2: Update to recent renames and add the new fields.

Signed-off-by: Paulo Zanoni <cc0e04a2103c45cd195651d976f79813d0f66bdf@intel.com>
Reviewed-by: Rodrigo Vivi <f714145d6ee82178e54021e0c168f56d17b53c9c@gmail.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>


drm/i915: Fix some gcc warnings

drm/i915: Fix some gcc warnings

Simple one:
drivers/gpu/drm/i915/i915_debugfs.c:2449:57: warning: Using plain integer as NULL pointer

And something a bit more peculiar:
drivers/gpu/drm/i915/i915_debugfs.c:4953:18: warning: Variable length array is used.
drivers/gpu/drm/i915/i915_debugfs.c:4953:32: warning: Variable length array is used.

We pass a 'const int' as the array size which results in the warning,
dropping the const gets rid of the warning. Weird, but I think getting
rid of the warnings is better than holding on to the const.

Signed-off-by: Ville Syrjälä <cd6e8d405ca90be3a03d5427c5b24fbd2d68dcc4@linux.intel.com>
Reviewed-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>


drm/i915: Wire up CRC support for gen3/4

Reviewed-by: Ville Syrjälä <cd6e8d405ca90be3a03d5427c5b24fbd2d68dcc4@linux.intel.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>


drm/i915: Fold in intel_mst_port_dp_detect

The indirection here seems to serve no purpose. Probably leftovers
from earlier revisions. Spotted while trying to review some mst
patches.

Cc: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@gmail.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@intel.com>


FIX (#871): Property documentation for the mitkImageMapper2D.h. Bug closed

--- Core/Rendering/mitkImageMapper2D.h
+++ Core/Rendering/mitkImageMapper2D.h
@@ -59,6 +59,33 @@
  * requested direction. This results in a stretched version when used for texture
  * mapping.
  *
+
+ * Properties that can be set for images and influence the imageMapper2D are:
+ *
+ *   - \b "opacity": (FloatProperty) Opacity of the image
+ *   - \b "color": (ColorProperty) Color of the image
+ *   - \b "use color": (BoolProperty) Use the color of the image or not
+ *   - \b "binary": (BoolProperty) is the image a binary image or not
+ *   - \b "outline binary": (BoolProperty) show outline of the image or not
+ *   - \b "texture interpolation": (BoolProperty) texture interpolation of the image
+ *   - \b "reslice interpolation": (VtkResliceInterpolationProperty) reslice interpolation of the image
+ *   - \b "in plane resample extent by geometry": (BoolProperty) Do it or not
+ *   - \b "bounding box": (BoolProperty) Is the Bounding Box of the image shown or not
+ *   - \b "layer": (IntProperty) Layer of the image
+
+ The default properties are:
+
+ *   - \b "opacity", mitk::FloatProperty::New(0.3f), renderer, overwrite )
+ *   - \b "color", ColorProperty::New(1.0,0.0,0.0), renderer, overwrite )
+ *   - \b "use color", mitk::BoolProperty::New( true ), renderer, overwrite )
+ *   - \b "binary", mitk::BoolProperty::New( true ), renderer, overwrite )
+ *   - \b "outline binary", mitk::BoolProperty::New( false ), renderer, overwrite )
+ *   - \b "texture interpolation", mitk::BoolProperty::New( mitk::DataTreeNodeFactory::m_TextureInterpolationActive ) )
+ *   - \b "reslice interpolation", mitk::VtkResliceInterpolationProperty::New() )
+ *   - \b "in plane resample extent by geometry", mitk::BoolProperty::New( false ) )
+ *   - \b "bounding box", mitk::BoolProperty::New( false ) )
+ *   - \b "layer", mitk::IntProperty::New(10), renderer, overwrite)
+
  * \ingroup Mapper
  */
 class MITK_CORE_EXPORT ImageMapper2D : public GLMapper2D


drm/nv04-nv40: Fix up the programmed horizontal sync pulse delay.

The calculated values were a little bit off (~16 clocks), the only
effect it could have had is a slightly offset image with respect to
the blob on analog outputs (bug 26790).

Signed-off-by: Francisco Jerez <5906ff32bdd9fd8db196f6ba5ad3afd6f9257ea5@riseup.net>
Signed-off-by: Ben Skeggs <d9f27fb07c1e9f131223ad827fa5179f3846c30b@redhat.com>

--- drivers/gpu/drm/nouveau/nv04_crtc.c
+++ drivers/gpu/drm/nouveau/nv04_crtc.c
@@ -230,9 +230,9 @@
 	struct drm_framebuffer *fb = crtc->fb;

 	/* Calculate our timings */
-	int horizDisplay	= (mode->crtc_hdisplay >> 3) 	- 1;
-	int horizStart		= (mode->crtc_hsync_start >> 3) 	- 1;
-	int horizEnd		= (mode->crtc_hsync_end >> 3) 	- 1;
+	int horizDisplay	= (mode->crtc_hdisplay >> 3)		- 1;
+	int horizStart		= (mode->crtc_hsync_start >> 3) 	+ 1;
+	int horizEnd		= (mode->crtc_hsync_end >> 3)		+ 1;
 	int horizTotal		= (mode->crtc_htotal >> 3)		- 5;
 	int horizBlankStart	= (mode->crtc_hdisplay >> 3)		- 1;
 	int horizBlankEnd	= (mode->crtc_htotal >> 3)		- 1;


drm/radeon: async event synchronization for drmWaitVblank

Bring radeon up to speed with the async event synchronization for
drmWaitVblank. See c9a9c5e02aedc1a2815877b0268f886d2640b771 for
more information. Without this patch event never get delivered
to userspace client.

Signed-off-by: Jerome Glisse <0620d428a1bd3756b1319066bf466b3b8be0b2b2@redhat.com>
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- drivers/gpu/drm/radeon/radeon_drv.c
+++ drivers/gpu/drm/radeon/radeon_drv.c
@@ -216,6 +216,7 @@
 		 .mmap = drm_mmap,
 		 .poll = drm_poll,
 		 .fasync = drm_fasync,
+		 .read = drm_read,
 #ifdef CONFIG_COMPAT
 		 .compat_ioctl = radeon_compat_ioctl,
 #endif
@@ -304,6 +305,7 @@
 		 .mmap = radeon_mmap,
 		 .poll = drm_poll,
 		 .fasync = drm_fasync,
+		 .read = drm_read,
 #ifdef CONFIG_COMPAT
 		 .compat_ioctl = radeon_kms_compat_ioctl,
 #endif


IB/multicast: Report errors on multicast groups if P_key changes

P_key changes can invalidate multicast groups.  Report errors on all
multicast groups affected by a pkey change.

Signed-off-by: Sean Hefty <9575f92314b8ac7581ac1b2afb880058b7fbd431@intel.com>
Signed-off-by: Roland Dreier <91e9b5f7ca0bb6300133ed378670d64af90dde66@cisco.com>

--- drivers/infiniband/core/multicast.c
+++ drivers/infiniband/core/multicast.c
@@ -73,11 +73,20 @@
 };

 enum mcast_state {
-	MCAST_IDLE,
 	MCAST_JOINING,
 	MCAST_MEMBER,
+	MCAST_ERROR,
+};
+
+enum mcast_group_state {
+	MCAST_IDLE,
 	MCAST_BUSY,
-	MCAST_ERROR
+	MCAST_GROUP_ERROR,
+	MCAST_PKEY_EVENT
+};
+
+enum {
+	MCAST_INVALID_PKEY_INDEX = 0xFFFF
 };

 struct mcast_member;
@@ -93,9 +102,10 @@
 	struct mcast_member	*last_join;
 	int			members[3];
 	atomic_t		refcount;
-	enum mcast_state	state;
+	enum mcast_group_state	state;
 	struct ib_sa_query	*query;
 	int			query_id;
+	u16			pkey_index;
 };

 struct mcast_member {
@@ -378,9 +388,19 @@
 static void process_group_error(struct mcast_group *group)
 {
 	struct mcast_member *member;
-	int ret;
+	int ret = 0;
+	u16 pkey_index;
+
+	if (group->state == MCAST_PKEY_EVENT)
+		ret = ib_find_pkey(group->port->dev->device,
+				   group->port->port_num,
+				   be16_to_cpu(group->rec.pkey), &pkey_index);

 	spin_lock_irq(&group->lock);
+	if (group->state == MCAST_PKEY_EVENT && !ret &&
+	    group->pkey_index == pkey_index)
+		goto out;
+
 	while (!list_empty(&group->active_list)) {
 		member = list_entry(group->active_list.next,
 				    struct mcast_member, list);
@@ -399,6 +419,7 @@
 	}

 	group->rec.join_state = 0;
+out:
 	group->state = MCAST_BUSY;
 	spin_unlock_irq(&group->lock);
 }
@@ -415,9 +436,9 @@
 retest:
 	spin_lock_irq(&group->lock);
 	while (!list_empty(&group->pending_list) ||
-	       (group->state == MCAST_ERROR)) {
-
-		if (group->state == MCAST_ERROR) {
+	       (group->state != MCAST_BUSY)) {
+
+		if (group->state != MCAST_BUSY) {
 			spin_unlock_irq(&group->lock);
 			process_group_error(group);
 			goto retest;
@@ -494,12 +515,19 @@
 			 void *context)
 {
 	struct mcast_group *group = context;
+	u16 pkey_index = MCAST_INVALID_PKEY_INDEX;

 	if (status)
 		process_join_error(group, status);
 	else {
+		ib_find_pkey(group->port->dev->device, group->port->port_num,
+			     be16_to_cpu(rec->pkey), &pkey_index);
+
 		spin_lock_irq(&group->port->lock);
 		group->rec = *rec;
+		if (group->state == MCAST_BUSY &&
+		    group->pkey_index == MCAST_INVALID_PKEY_INDEX)
+			group->pkey_index = pkey_index;
 		if (!memcmp(&mgid0, &group->rec.mgid, sizeof mgid0)) {
 			rb_erase(&group->node, &group->port->table);
 			mcast_insert(group->port, group, 1);
@@ -539,6 +567,7 @@

 	group->port = port;
 	group->rec.mgid = *mgid;
+	group->pkey_index = MCAST_INVALID_PKEY_INDEX;
 	INIT_LIST_HEAD(&group->pending_list);
 	INIT_LIST_HEAD(&group->active_list);
 	INIT_WORK(&group->work, mcast_work_handler);
@@ -707,7 +736,8 @@
 }
 EXPORT_SYMBOL(ib_init_ah_from_mcmember);

-static void mcast_groups_lost(struct mcast_port *port)
+static void mcast_groups_event(struct mcast_port *port,
+			       enum mcast_group_state state)
 {
 	struct mcast_group *group;
 	struct rb_node *node;
@@ -721,7 +751,8 @@
 			atomic_inc(&group->refcount);
 			queue_work(mcast_wq, &group->work);
 		}
-		group->state = MCAST_ERROR;
+		if (group->state != MCAST_GROUP_ERROR)
+			group->state = state;
 		spin_unlock(&group->lock);
 	}
 	spin_unlock_irqrestore(&port->lock, flags);
@@ -731,16 +762,20 @@
 				struct ib_event *event)
 {
 	struct mcast_device *dev;
+	int index;

 	dev = container_of(handler, struct mcast_device, event_handler);
+	index = event->element.port_num - dev->start_port;

 	switch (event->event) {
 	case IB_EVENT_PORT_ERR:
 	case IB_EVENT_LID_CHANGE:
 	case IB_EVENT_SM_CHANGE:
 	case IB_EVENT_CLIENT_REREGISTER:
-		mcast_groups_lost(&dev->port[event->element.port_num -
-					     dev->start_port]);
+		mcast_groups_event(&dev->port[index], MCAST_GROUP_ERROR);
+		break;
+	case IB_EVENT_PKEY_CHANGE:
+		mcast_groups_event(&dev->port[index], MCAST_PKEY_EVENT);
 		break;
 	default:
 		break;


Replace bus_space_read_2() by the BCW_READ16 macro.

--- dev/ic/bcw.c
+++ dev/ic/bcw.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: bcw.c,v 1.20 2007/01/03 06:20:14 mglocker Exp $ */
+/*	$OpenBSD: bcw.c,v 1.21 2007/01/03 06:24:09 mglocker Exp $ */

 /*
  * Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -2027,14 +2027,12 @@
 		BCW_WRITE16(sc, BCW_RADIO_CONTROL, 0x05);
 		BCW_WRITE16(sc, BCW_RADIO_DATALOW, 0xfb);
 		BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x10);
-		sbval16 = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
-		    BCW_PHY_DATA);
+		sbval16 = BCW_READ16(sc, BCW_PHY_DATA);
 		sbval16 |= 0x8;
 		BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x10);
 		BCW_WRITE16(sc, BCW_PHY_DATA, sbval16);
 		BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x11);
-		sbval16 = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
-		    BCW_PHY_DATA);
+		sbval16 = BCW_READ16(sc, BCW_PHY_DATA);
 		sbval16 |= 0x8;
 		BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x11);
 		BCW_WRITE16(sc, BCW_PHY_DATA, sbval16);
@@ -2042,14 +2040,12 @@
 	case BCW_PHY_TYPEG:
 		if (sc->sc_core_80211->rev >= 5) {
 			BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x811);
-			sbval16 = bus_space_read_2(sc->sc_iot,
-			    sc->sc_ioh, BCW_PHY_DATA);
+			sbval16 = BCW_READ16(sc, BCW_PHY_DATA);
 			sbval16 |= 0x8c;
 			BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x811);
 			BCW_WRITE16(sc, BCW_PHY_DATA, sbval16);
 			BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x812);
-			sbval16 = bus_space_read_2(sc->sc_iot,
-			    sc->sc_ioh, BCW_PHY_DATA);
+			sbval16 = BCW_READ16(sc, BCW_PHY_DATA);
 			sbval16 &= 0xff73;
 			BCW_WRITE16(sc, BCW_PHY_CONTROL, 0x812);
 			BCW_WRITE16(sc, BCW_PHY_DATA, sbval16);


decreased rx attempts because 10 is too much

--- sw/uart.h
+++ sw/uart.h
@@ -11,7 +11,7 @@
 #define UART_RX_BUFFER_LEN 4096
 #define UART_TX_BUFFER_LEN 4096

-#define UART_RX_ATTEMPTS 10
+#define UART_RX_ATTEMPTS 5

 typedef enum UART_TYPE_enum
 {


Input: ads7846 - stop updating dev->power.power_state

This stops the ads7846 driver from using dev->power.power_state; that field is
deprecated (overdue for removal) and the only reason to update it was to make
the /sys/devices/.../power/state files (now removed) work better.

Signed-off-by: David Brownell <a0d09457d62acbdeb1fae1223575100ccbfffdf9@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <10a8c465cefc9bdd6c925e26964d23c90f1141cc@mail.ru>

--- drivers/input/touchscreen/ads7846.c
+++ drivers/input/touchscreen/ads7846.c
@@ -116,6 +116,7 @@
 // FIXME remove "irq_disabled"
 	unsigned		irq_disabled:1;	/* P: lock */
 	unsigned		disabled:1;
+	unsigned		is_suspended:1;

 	int			(*filter)(void *data, int data_idx, int *val);
 	void			*filter_data;
@@ -203,7 +204,7 @@
 static int device_suspended(struct device *dev)
 {
 	struct ads7846 *ts = dev_get_drvdata(dev);
-	return dev->power.power_state.event != PM_EVENT_ON || ts->disabled;
+	return ts->is_suspended || ts->disabled;
 }

 static int ads7846_read12_ser(struct device *dev, unsigned command)
@@ -795,7 +796,7 @@

 	spin_lock_irq(&ts->lock);

-	spi->dev.power.power_state = message;
+	ts->is_suspended = 1;
 	ads7846_disable(ts);

 	spin_unlock_irq(&ts->lock);
@@ -810,7 +811,7 @@

 	spin_lock_irq(&ts->lock);

-	spi->dev.power.power_state = PMSG_ON;
+	ts->is_suspended = 0;
 	ads7846_enable(ts);

 	spin_unlock_irq(&ts->lock);
@@ -872,7 +873,6 @@
 	}

 	dev_set_drvdata(&spi->dev, ts);
-	spi->dev.power.power_state = PMSG_ON;

 	ts->spi = spi;
 	ts->input = input_dev;