fixing documentation for attribute put functions

--- libdispatch/dattput.c
+++ libdispatch/dattput.c
@@ -26,15 +26,11 @@
  * @param ncid NetCDF or group ID, from a previous call to nc_open(),
  * nc_create(), nc_def_grp(), or associated inquiry functions such as
  * nc_inq_ncid().
- *
  * @param varid Variable ID of the variable to which the attribute
  * will be assigned or ::NC_GLOBAL for a global or group attribute.
- *
  * @param name Attribute \ref object_name. \ref attribute_conventions
  * may apply.
- *
  * @param len Number of values provided for the attribute.
- *
  * @param value Pointer to one or more values.
  *
  * @return ::NC_NOERR No error.
@@ -68,121 +64,20 @@
  * netCDF dataset must be in define mode for classic formats (or
  * netCDF-4/HDF5 with NC_CLASSIC_MODEL).
  *
- * Although it's possible to create attributes of all types, text and
- * double attributes are adequate for most purposes.
- *
- * Use the nc_put_att function to create attributes of any type,
- * including user-defined types. We recommend using the type safe
- * versions of this function whenever possible.
+ * Type conversion is not available with text attributes.
  *
  * @param ncid NetCDF or group ID, from a previous call to nc_open(),
  * nc_create(), nc_def_grp(), or associated inquiry functions such as
  * nc_inq_ncid().
- *
  * @param varid Variable ID of the variable to which the attribute
  * will be assigned or ::NC_GLOBAL for a global attribute.
- *
  * @param name Attribute \ref object_name. \ref attribute_conventions
  * may apply.
- *
- * @param len Number of values provided for the attribute.
- *
- * @param value Pointer to one or more values.
- *
- * @return ::NC_NOERR No error.
- * @return ::NC_EINVAL More than one value for _FillValue or trying to set global _FillValue.
- * @return ::NC_ENOTVAR Couldn't find varid.
- * @return ::NC_EBADTYPE Fill value and var must be same type.
- * @return ::NC_ENOMEM Out of memory
- * @return ::NC_ELATEFILL Fill values must be written while the file
- * is still in initial define mode.
- *
- * @note With netCDF-4 files, nc_put_att will notice if you are
- * writing a _Fill_Value_ attribute, and will tell the HDF5 layer to
- * use the specified fill value for that variable.
- *
- * @section nc_put_att_text_example Example
- *
- * Here is an example using nc_put_att_double() to add a variable
- * attribute named valid_range for a netCDF variable named rh and
- * nc_put_att_text() to add a global attribute named title to an
- * existing netCDF dataset named foo.nc:
- *
-@code
-     #include <netcdf.h>
-        ...
-     int  status;
-     int  ncid;
-     int  rh_id;
-     static double rh_range[] = {0.0, 100.0};
-     static char title[] = "example netCDF dataset";
-        ...
-     status = nc_open("foo.nc", NC_WRITE, &ncid);
-     if (status != NC_NOERR) handle_error(status);
-        ...
-     status = nc_redef(ncid);
-     if (status != NC_NOERR) handle_error(status);
-     status = nc_inq_varid (ncid, "rh", &rh_id);
-     if (status != NC_NOERR) handle_error(status);
-        ...
-     status = nc_put_att_double (ncid, rh_id, "valid_range",
-                                 NC_DOUBLE, 2, rh_range);
-     if (status != NC_NOERR) handle_error(status);
-     status = nc_put_att_text (ncid, NC_GLOBAL, "title",
-                               strlen(title), title)
-     if (status != NC_NOERR) handle_error(status);
-        ...
-     status = nc_enddef(ncid);
-     if (status != NC_NOERR) handle_error(status);
-@endcode
-
-* @author Glenn Davis, Ed Hartnett, Dennis Heimbigner
-*/
-int nc_put_att_text(int ncid, int varid, const char *name,
-		size_t len, const char *value)
-{
-   NC* ncp;
-   int stat = NC_check_id(ncid, &ncp);
-   if(stat != NC_NOERR) return stat;
-   return ncp->dispatch->put_att(ncid, varid, name, NC_CHAR, len,
-				 (void *)value, NC_CHAR);
-}
-/** \} */
-/**
- * @ingroup attributes
- * Write an attribute.
- *
- * The function nc_put_att_ type adds or changes a variable attribute
- * or global attribute of an open netCDF dataset. If this attribute is
- * new, or if the space required to store the attribute is greater
- * than before, the netCDF dataset must be in define mode for classic
- * formats (or netCDF-4/HDF5 with NC_CLASSIC_MODEL).
- *
- * With netCDF-4 files, nc_put_att will notice if you are writing a
- * _FillValue attribute, and will tell the HDF5 layer to use the
- * specified fill value for that variable.  With either classic or
- * netCDF-4 files, a _FillValue attribute will be checked for
- * validity, to make sure it has only one value and that its type
- * matches the type of the associated variable.
- *
- * Although it's possible to create attributes of all types, text and
- * double attributes are adequate for most purposes.
- *
- * @param ncid NetCDF or group ID, from a previous call to nc_open(),
- * nc_create(), nc_def_grp(), or associated inquiry functions such as
- * nc_inq_ncid().
- *
- * @param varid Variable ID of the variable to which the attribute will
- * be assigned or ::NC_GLOBAL for a global or group attribute.
- *
- * @param name Attribute \ref object_name. \ref attribute_conventions
- * may apply.
- *
- * @param xtype \ref data_type of the attribute.
- *
- * @param len Number of values provided for the attribute.
- *
- * @param value Pointer to one or more values.
+ * @param len The length of the text array. @Note Whether or not this
+ * length includes the NULL character in C char arrays is a user
+ * decision. If the NULL character is not written, then all C programs
+ * must add the NULL character after reading a text attribute.
+ * @param value Pointer to the start of the character array.
  *
  * @return ::NC_NOERR No error.
  * @return ::NC_EINVAL More than one value for _FillValue or trying to
@@ -193,7 +88,7 @@
  * @return ::NC_ELATEFILL Fill values must be written while the file
  * is still in initial define mode.
  *
- * @section nc_put_att_double_example Example
+ * @section nc_put_att_text_example Example
  *
  * Here is an example using nc_put_att_double() to add a variable
  * attribute named valid_range for a netCDF variable named rh and
@@ -227,6 +122,90 @@
      status = nc_enddef(ncid);
      if (status != NC_NOERR) handle_error(status);
 @endcode
+
+* @author Glenn Davis, Ed Hartnett, Dennis Heimbigner
+*/
+int nc_put_att_text(int ncid, int varid, const char *name,
+		size_t len, const char *value)
+{
+   NC* ncp;
+   int stat = NC_check_id(ncid, &ncp);
+   if(stat != NC_NOERR) return stat;
+   return ncp->dispatch->put_att(ncid, varid, name, NC_CHAR, len,
+				 (void *)value, NC_CHAR);
+}
+/** \} */
+/**
+ * @ingroup attributes
+ * Write an attribute.
+ *
+ * The function nc_put_att_<type> adds or changes a variable attribute
+ * or global attribute of an open netCDF dataset. If this attribute is
+ * new, or if the space required to store the attribute is greater
+ * than before, the netCDF dataset must be in define mode for classic
+ * formats (or netCDF-4/HDF5 with NC_CLASSIC_MODEL).
+ *
+ * With netCDF-4 files, nc_put_att_<type> will notice if you are
+ * writing a _FillValue attribute, and will tell the HDF5 layer to use
+ * the specified fill value for that variable.  With either classic or
+ * netCDF-4 files, a _FillValue attribute will be checked for
+ * validity, to make sure it has only one value and that its type
+ * matches the type of the associated variable.
+ *
+ * @param ncid NetCDF or group ID, from a previous call to nc_open(),
+ * nc_create(), nc_def_grp(), or associated inquiry functions such as
+ * nc_inq_ncid().
+ * @param varid Variable ID of the variable to which the attribute will
+ * be assigned or ::NC_GLOBAL for a global or group attribute.
+ * @param name Attribute \ref object_name. \ref attribute_conventions
+ * may apply.
+ * @param xtype \ref data_type of the attribute.
+ * @param len Number of values provided for the attribute.
+ * @param value Pointer to one or more values.
+ *
+ * @return ::NC_NOERR No error.
+ * @return ::NC_EINVAL More than one value for _FillValue or trying to
+ * set global _FillValue.
+ * @return ::NC_ENOTVAR Couldn't find varid.
+ * @return ::NC_EBADTYPE Fill value and var must be same type.
+ * @return ::NC_ENOMEM Out of memory
+ * @return ::NC_ELATEFILL Fill values must be written while the file
+ * is still in initial define mode.
+ *
+ * @section nc_put_att_double_example Example
+ *
+ * Here is an example using nc_put_att_double() to add a variable
+ * attribute named valid_range for a netCDF variable named rh and
+ * nc_put_att_text() to add a global attribute named title to an
+ * existing netCDF dataset named foo.nc:
+ *
+@code
+     #include <netcdf.h>
+        ...
+     int  status;
+     int  ncid;
+     int  rh_id;
+     static double rh_range[] = {0.0, 100.0};
+     static char title[] = "example netCDF dataset";
+        ...
+     status = nc_open("foo.nc", NC_WRITE, &ncid);
+     if (status != NC_NOERR) handle_error(status);
+        ...
+     status = nc_redef(ncid);
+     if (status != NC_NOERR) handle_error(status);
+     status = nc_inq_varid (ncid, "rh", &rh_id);
+     if (status != NC_NOERR) handle_error(status);
+        ...
+     status = nc_put_att_double (ncid, rh_id, "valid_range",
+                                 NC_DOUBLE, 2, rh_range);
+     if (status != NC_NOERR) handle_error(status);
+     status = nc_put_att_text (ncid, NC_GLOBAL, "title",
+                               strlen(title), title)
+     if (status != NC_NOERR) handle_error(status);
+        ...
+     status = nc_enddef(ncid);
+     if (status != NC_NOERR) handle_error(status);
+@endcode
 * @author Glenn Davis, Ed Hartnett, Dennis Heimbigner
 */
 /** \{*/


add license

add license

--- libexif/exif-system.h
+++ libexif/exif-system.h
@@ -1,5 +1,22 @@
 /** \file exif-system.h
  * \brief System specific definitions, not for installation!
+ *
+ * Copyright (C) 2007 Hans Ulrich Niedermann <gp@n-dimensional.de>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
  */

 #ifndef EXIF_SYSTEM_H


freerdp/core/gcc: channel name hardening

According to [MS-RDPBCGR 2.2.1.3.4.1 Channel Definition Structure]
the channel name must be an 8-byte array containing a null-terminated
collection of seven ANSI characters that uniquely identify the channel.

We did not check if the transmitted name was null-terminated which
could have the usual severe effects on stabiliy and security since
the channel name is used in several functions expecting a null-
terminated string (strlen, printf, etc.)

--- libfreerdp/core/gcc.c
+++ libfreerdp/core/gcc.c
@@ -1428,8 +1428,18 @@
 	/* channelDefArray */
 	for (i = 0; i < mcs->channelCount; i++)
 	{
-		/* CHANNEL_DEF */
+		/**
+		 * CHANNEL_DEF
+		 * - name: an 8-byte array containing a null-terminated collection
+		 *   of seven ANSI characters that uniquely identify the channel.
+		 * - options: a 32-bit, unsigned integer. Channel option flags
+		 */
 		Stream_Read(s, mcs->channels[i].Name, 8); /* name (8 bytes) */
+		if (!memchr(mcs->channels[i].Name, 0, 8))
+		{
+			WLog_ERR(TAG, "protocol violation: received a static channel name with missing null-termination");
+			return FALSE;
+		}
 		Stream_Read_UINT32(s, mcs->channels[i].options); /* options (4 bytes) */
 		mcs->channels[i].ChannelId = mcs->baseChannelId++;
 	}


Fix for complaing about ip addr chg

Fix for complaing about ip addr chg

--- src/unix/ifnet.c
+++ src/unix/ifnet.c
@@ -272,7 +272,7 @@
       OLSR_PRINTF(3, "\tAddress:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));
 #endif

-    if (ip4equal(&ifp->int_addr.sin_addr, &tmp_saddr4->sin_addr)) {
+    if (!ip4equal(&ifp->int_addr.sin_addr, &tmp_saddr4->sin_addr)) {
       /* New address */
       OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name);
       OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));


[core] properly pass redirection return code

If a redirection packet is receivet pass the appropriate return
code through the call stack to let the client take action

--- libfreerdp/core/rdp.c
+++ libfreerdp/core/rdp.c
@@ -1812,6 +1812,8 @@
 				         "%s: %s - "
 				         "rdp_client_connect_demand_active() - %i",
 				         __FUNCTION__, rdp_get_state_string(rdp), status);
+			else if (status == 1)
+				status = 1;
 			else
 			{
 				if (!rdp->settings->SupportMonitorLayoutPdu)


update uoj_336043

update uoj_336043


[lib] more selective mask to catch uevent from netlink

Kay Sievers reports 0x01 is the only group used by the kernel.
As udev will start using other groups, pollution will result from
our lack of filtering.

--- libmultipath/uevent.c
+++ libmultipath/uevent.c
@@ -165,7 +165,7 @@
 		memset(&snl, 0x00, sizeof(struct sockaddr_nl));
 		snl.nl_family = AF_NETLINK;
 		snl.nl_pid = getpid();
-		snl.nl_groups = 0xffffffff;
+		snl.nl_groups = 0x01;

 		sock = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
 		if (sock == -1) {


There is no need to call uv_async_send() when the process has terminated.

--- src/util/trash.h
+++ src/util/trash.h
@@ -41,9 +41,8 @@
     inline void Add(T* item) {
         {
             std::lock_guard<std::mutex> guard(lock);
-            if (!terminated) {
-                values.emplace_back(std::unique_ptr<T>(item));
-            }
+            if (terminated) return;
+            values.emplace_back(std::unique_ptr<T>(item));
         }

         /* Call to uv_async_send() should never return nonzero. UV ensures


fix accounting of medium resends

fix accounting of medium resends

git-svn-id: 29c1264a5cf5e3532df57b06678e7347571c1a3c@1349 f1ba3bf5-cb5c-402b-92a9-7c6bdc83a356

--- libopen-mx/omx_send.c
+++ libopen-mx/omx_send.c
@@ -325,7 +325,7 @@
   req->send.specific.medium.frags_pending_nr = frags_nr;

  ok:
-  req->generic.resends_max = ep->req_resends_max;
+  req->generic.resends++;
   req->generic.last_send_jiffies = omx__driver_desc->jiffies;
   req->generic.state |= OMX_REQUEST_STATE_IN_DRIVER;
   omx__enqueue_request(&ep->driver_posted_req_q, req);


manifest emiter now writes UNKNOWN if www information is not provided

--- libpkg/pkg_manifest.c
+++ libpkg/pkg_manifest.c
@@ -328,7 +328,7 @@
 			pkg_get(pkg, PKG_COMMENT),
 			pkg_get(pkg, PKG_ARCH),
 			pkg_get(pkg, PKG_OSVERSION),
-			pkg_get(pkg, PKG_WWW),
+			pkg_get(pkg, PKG_WWW) ? pkg_get(PKG_WWW) : "UNKNOWN",
 			pkg_get(pkg, PKG_MAINTAINER) ? pkg_get(pkg, PKG_MAINTAINER) : "UNKNOWN",
 			pkg_get(pkg, PKG_PREFIX),
 			pkg_flatsize(pkg)


Fix bug that made pkg repo segfault

Fix bug that made pkg repo segfault

Introduced in 5dc36026fc60c64763d82a69ef2921b3cd78e913, pkg repo -l
crashed on packages (meta ports) that don't install files on their own.

--- libpkg/pkg_manifest.c
+++ libpkg/pkg_manifest.c
@@ -803,7 +803,8 @@
 		urlencode(pkg_file_path(file), &b);
 		seq = ucl_array_append(seq, ucl_object_fromlstring(sbuf_data(b), sbuf_len(b)));
 	}
-	obj = ucl_object_insert_key(obj, seq, "files", 5, false);
+	if (seq != NULL)
+		obj = ucl_object_insert_key(obj, seq, "files", 5, false);

 	output = ucl_object_emit(obj, UCL_EMIT_JSON_COMPACT);
 	fprintf(f, "%s", output);


Reintroduce static C methods where applicable
Stub for class information

git-svn-id: 9828a123601097aec97c9db06897c34ab9021696@490 f1b219a8-1381-427d-9730-7f2851dc2a88

--- src-agent-c/dislagent.c
+++ src-agent-c/dislagent.c
@@ -56,7 +56,7 @@

 // ******************* Helper routines *******************

-message create_message(const unsigned char * control,
+static message create_message(const unsigned char * control,
 		jint control_size, const unsigned char * classcode,
 		jint classcode_size) {

@@ -98,7 +98,7 @@
 	return result;
 }

-void free_message(message * msg) {
+static void free_message(message * msg) {

 	if(msg->control != NULL) {

@@ -117,7 +117,7 @@
 	}
 }

-void parse_agent_options(char *options) {
+static void parse_agent_options(char *options) {

 	static const char PORT_DELIM = ':';

@@ -158,7 +158,7 @@
 // ******************* Communication routines *******************

 // sends class over network
-void send_msg(connection_item * conn, message * msg) {
+static void send_msg(connection_item * conn, message * msg) {

 #ifdef DEBUG
 	printf("Sending - control: %d, code: %d ... ", msg->control_size, msg->classcode_size);
@@ -186,7 +186,7 @@
 }

 // receives class from network
-message rcv_msg(connection_item * conn) {
+static message rcv_msg(connection_item * conn) {

 #ifdef DEBUG
 	printf("Receiving ");
@@ -232,7 +232,7 @@
 	return create_message(control, -control_size, classcode, -classcode_size);
 }

-connection_item * open_connection() {
+static connection_item * open_connection() {

 	// get host address
 	struct addrinfo * addr;
@@ -266,7 +266,7 @@
 	return conn;
 }

-void close_connection(connection_item * conn) {
+static void close_connection(connection_item * conn) {

 	// prepare close message - could be done more efficiently (this is nicer)
 	// close message has zeros as lengths
@@ -286,7 +286,7 @@
 }

 // get an available connection, create one if no one is available
-connection_item * acquire_connection() {
+static connection_item * acquire_connection() {

 #ifdef DEBUG
 	printf("Acquiring connection ... ");
@@ -330,7 +330,7 @@
 }

 // make the socket available again
-void release_connection(connection_item * conn) {
+static void release_connection(connection_item * conn) {

 #ifdef DEBUG
 	printf("Releasing connection ... ");
@@ -351,7 +351,7 @@
 }

 // instruments remotely
-message instrument_class(const char * classname,
+static message instrument_class(const char * classname,
 		const unsigned char * classcode, jint classcode_size) {

 	// get available connection


validation CHANGE always consider opaque nodes invalid

--- src/validation.c
+++ src/validation.c
@@ -871,9 +871,16 @@
             break;
         }

+        /* opaque data */
+        if (!node->schema) {
+            LOGVAL(LYD_NODE_CTX(node), LY_VLOG_LYD, node, LYVE_DATA, "Opaque node \"%s\" found.",
+                   ((struct lyd_node_opaq *)node)->name);
+            return LY_EVALID;
+        }
+
         /* no state data */
         if ((val_opts & LYD_VALOPT_NO_STATE) && (node->schema->flags & LYS_CONFIG_R)) {
-            LOGVAL(node->schema->module->ctx, LY_VLOG_LYD, node, LY_VCODE_INSTATE, node->schema->name);
+            LOGVAL(LYD_NODE_CTX(node), LY_VLOG_LYD, node, LY_VCODE_INSTATE, node->schema->name);
             return LY_EVALID;
         }

@@ -882,14 +889,14 @@

         /* node's schema if-features */
         if ((snode = lysc_node_is_disabled(node->schema, 1))) {
-            LOGVAL(node->schema->module->ctx, LY_VLOG_LYD, node, LY_VCODE_NOIFF, snode->name);
+            LOGVAL(LYD_NODE_CTX(node), LY_VLOG_LYD, node, LY_VCODE_NOIFF, snode->name);
             return LY_EVALID;
         }

         /* node's musts */
         LY_CHECK_RET(lyd_validate_must(node));

-        /* node value including if-feature is checked by plugins */
+        /* node value including if-feature was checked by plugins */
     }

     /* validate schema-based restrictions */


default enable RBF

default enable RBF

--- src/validation.h
+++ src/validation.h
@@ -124,7 +124,7 @@
 /** Default for -persistmempool */
 static const bool DEFAULT_PERSIST_MEMPOOL = true;
 /** Default for -mempoolreplacement */
-static const bool DEFAULT_ENABLE_REPLACEMENT = false;
+static const bool DEFAULT_ENABLE_REPLACEMENT = true;
 /** Default for using fee filter */
 static const bool DEFAULT_FEEFILTER = true;

@@ -230,7 +230,6 @@
  *
  * @param[in]   pblock  The block we want to process.
  * @param[in]   fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.
- * @param[out]  dbp     The already known disk position of pblock, or nullptr if not yet stored.
  * @param[out]  fNewBlock A boolean which is set to indicate if the block was first received via this call
  * @return True if state.IsValid()
  */


vcl: avoid epoll cleanup before app close

Type: fix

Signed-off-by: Florin Coras <c9715e5cdf0718c2e9b10678757dfb027875eba2@cisco.com>
Change-Id: I09f9faab72e6b77c975b8b79694081216c6ba115

--- src/vcl/vppcom.c
+++ src/vcl/vppcom.c
@@ -765,6 +765,60 @@
   return session;
 }

+static int
+vppcom_session_disconnect (u32 session_handle)
+{
+  vcl_worker_t *wrk = vcl_worker_get_current ();
+  svm_msg_q_t *vpp_evt_q;
+  vcl_session_t *session, *listen_session;
+  vcl_session_state_t state;
+  u64 vpp_handle;
+
+  session = vcl_session_get_w_handle (wrk, session_handle);
+  if (!session)
+    return VPPCOM_EBADFD;
+
+  vpp_handle = session->vpp_handle;
+  state = session->session_state;
+
+  VDBG (1, "session %u [0x%llx] state 0x%x (%s)", session->session_index,
+	vpp_handle, state, vppcom_session_state_str (state));
+
+  if (PREDICT_FALSE (state == VCL_STATE_LISTEN))
+    {
+      VDBG (0, "ERROR: Cannot disconnect a listen socket!");
+      return VPPCOM_EBADFD;
+    }
+
+  if (state == VCL_STATE_VPP_CLOSING)
+    {
+      vpp_evt_q = vcl_session_vpp_evt_q (wrk, session);
+      vcl_send_session_disconnected_reply (vpp_evt_q, wrk->api_client_handle,
+					   vpp_handle, 0);
+      VDBG (1, "session %u [0x%llx]: sending disconnect REPLY...",
+	    session->session_index, vpp_handle);
+    }
+  else
+    {
+      /* Session doesn't have an event queue yet. Probably a non-blocking
+       * connect. Wait for the reply */
+      if (PREDICT_FALSE (!session->vpp_evt_q))
+	return VPPCOM_OK;
+
+      VDBG (1, "session %u [0x%llx]: sending disconnect...",
+	    session->session_index, vpp_handle);
+      vcl_send_session_disconnect (wrk, session);
+    }
+
+  if (session->listener_index != VCL_INVALID_SESSION_INDEX)
+    {
+      listen_session = vcl_session_get (wrk, session->listener_index);
+      listen_session->n_accepted_sessions--;
+    }
+
+  return VPPCOM_OK;
+}
+
 static void
 vcl_session_cleanup_handler (vcl_worker_t * wrk, void *data)
 {
@@ -783,21 +837,26 @@
     {
       /* Transport was cleaned up before we confirmed close. Probably the
        * app is still waiting for some data that cannot be delivered.
-       * Confirm close to make sure everything is cleaned up */
-      if (session->session_state == VCL_STATE_VPP_CLOSING
-	  || session->session_state == VCL_STATE_DISCONNECT)
-	{
-	  vcl_session_cleanup (wrk, session, vcl_session_handle (session),
-			       1 /* do_disconnect */ );
-	  /* Move to undetermined state to ensure that the session is not
-	   * removed before both vpp and the app cleanup.
-	   * - If the app closes first, the session is moved to CLOSED state
-	   *   and the session cleanup notification from vpp removes the
-	   *   session.
-	   * - If vpp cleans up the session first, the session is moved to
-	   *   DETACHED state lower and subsequently the close from the app
-	   *   frees the session
-	   */
+       * Confirm close to make sure everything is cleaned up.
+       * Move to undetermined state to ensure that the session is not
+       * removed before both vpp and the app cleanup.
+       * - If the app closes first, the session is moved to CLOSED state
+       *   and the session cleanup notification from vpp removes the
+       *   session.
+       * - If vpp cleans up the session first, the session is moved to
+       *   DETACHED state lower and subsequently the close from the app
+       *   frees the session
+       */
+      if (session->session_state == VCL_STATE_VPP_CLOSING)
+	{
+	  vppcom_session_disconnect (vcl_session_handle (session));
+	  session->session_state = VCL_STATE_UPDATED;
+	}
+      else if (session->session_state == VCL_STATE_DISCONNECT)
+	{
+	  vcl_send_session_reset_reply (vcl_session_vpp_evt_q (wrk, session),
+					wrk->api_client_handle,
+					session->vpp_handle, 0);
 	  session->session_state = VCL_STATE_UPDATED;
 	}
       return;
@@ -1115,60 +1174,6 @@

   session->vpp_handle = ~0;
   session->session_state = VCL_STATE_DISCONNECT;
-
-  return VPPCOM_OK;
-}
-
-static int
-vppcom_session_disconnect (u32 session_handle)
-{
-  vcl_worker_t *wrk = vcl_worker_get_current ();
-  svm_msg_q_t *vpp_evt_q;
-  vcl_session_t *session, *listen_session;
-  vcl_session_state_t state;
-  u64 vpp_handle;
-
-  session = vcl_session_get_w_handle (wrk, session_handle);
-  if (!session)
-    return VPPCOM_EBADFD;
-
-  vpp_handle = session->vpp_handle;
-  state = session->session_state;
-
-  VDBG (1, "session %u [0x%llx] state 0x%x (%s)", session->session_index,
-	vpp_handle, state, vppcom_session_state_str (state));
-
-  if (PREDICT_FALSE (state == VCL_STATE_LISTEN))
-    {
-      VDBG (0, "ERROR: Cannot disconnect a listen socket!");
-      return VPPCOM_EBADFD;
-    }
-
-  if (state == VCL_STATE_VPP_CLOSING)
-    {
-      vpp_evt_q = vcl_session_vpp_evt_q (wrk, session);
-      vcl_send_session_disconnected_reply (vpp_evt_q, wrk->api_client_handle,
-					   vpp_handle, 0);
-      VDBG (1, "session %u [0x%llx]: sending disconnect REPLY...",
-	    session->session_index, vpp_handle);
-    }
-  else
-    {
-      /* Session doesn't have an event queue yet. Probably a non-blocking
-       * connect. Wait for the reply */
-      if (PREDICT_FALSE (!session->vpp_evt_q))
-	return VPPCOM_OK;
-
-      VDBG (1, "session %u [0x%llx]: sending disconnect...",
-	    session->session_index, vpp_handle);
-      vcl_send_session_disconnect (wrk, session);
-    }
-
-  if (session->listener_index != VCL_INVALID_SESSION_INDEX)
-    {
-      listen_session = vcl_session_get (wrk, session->listener_index);
-      listen_session->n_accepted_sessions--;
-    }

   return VPPCOM_OK;
 }


handle: factor out function

handle: factor out function

--- librsvg/rsvg-handle.c
+++ librsvg/rsvg-handle.c
@@ -771,6 +771,20 @@
     }
 }

+static RsvgDrawingCtx *
+rsvg_handle_create_drawing_ctx(RsvgHandle *handle,
+                               cairo_t *cr,
+                               RsvgDimensionData *dimensions)
+{
+    return rsvg_drawing_ctx_new (cr,
+                                 dimensions->width, dimensions->height,
+                                 dimensions->em, dimensions->ex,
+                                 handle->priv->dpi_x, handle->priv->dpi_y,
+                                 handle->priv->defs,
+                                 handle->priv->is_testing);
+
+}
+
 /**
  * rsvg_handle_render_cairo_sub:
  * @handle: A #RsvgHandle
@@ -820,12 +834,7 @@
     if (dimensions.width == 0 || dimensions.height == 0)
         return FALSE;

-    draw = rsvg_drawing_ctx_new (cr,
-                                 dimensions.width, dimensions.height,
-                                 dimensions.em, dimensions.ex,
-                                 handle->priv->dpi_x, handle->priv->dpi_y,
-                                 handle->priv->defs,
-                                 handle->priv->is_testing);
+    draw = rsvg_handle_create_drawing_ctx (handle, cr, &dimensions);

     rsvg_drawing_ctx_add_node_and_ancestors_to_stack (draw, drawsub);

@@ -948,16 +957,10 @@
         if (dimensions.width == 0 || dimensions.height == 0)
             return FALSE;

-        target = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
-                                             1, 1);
-        cr = cairo_create  (target);
-
-        draw = rsvg_drawing_ctx_new (cr,
-                                     dimensions.width, dimensions.height,
-                                     dimensions.em, dimensions.ex,
-                                     handle->priv->dpi_x, handle->priv->dpi_y,
-                                     handle->priv->defs,
-                                     handle->priv->is_testing);
+        target = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 1, 1);
+        cr = cairo_create (target);
+
+        draw = rsvg_handle_create_drawing_ctx (handle, cr, &dimensions);

         g_assert (sself != NULL);
         rsvg_drawing_ctx_add_node_and_ancestors_to_stack (draw, sself);
@@ -1045,14 +1048,9 @@
         return FALSE;

     target = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 1, 1);
-    cr = cairo_create  (target);
-
-    draw = rsvg_drawing_ctx_new (cr,
-                                 dimensions.width, dimensions.height,
-                                 dimensions.em, dimensions.ex,
-                                 handle->priv->dpi_x, handle->priv->dpi_y,
-                                 handle->priv->defs,
-                                 handle->priv->is_testing);
+    cr = cairo_create (target);
+
+    draw = rsvg_handle_create_drawing_ctx (handle, cr, &dimensions);

     g_assert (node != NULL);
     rsvg_drawing_ctx_add_node_and_ancestors_to_stack (draw, node);


rsvg-pixbuf.c: Don't acquire data by hand; just let the stream reader do it

--- librsvg/rsvg-pixbuf.c
+++ librsvg/rsvg-pixbuf.c
@@ -43,35 +43,19 @@
 #include <stdlib.h>

 static GdkPixbuf *
-rsvg_pixbuf_from_stdio_file_with_size_data (const char *data,
-                                            gsize data_len,
-                                            struct RsvgSizeCallbackData *cb_data,
-                                            gchar * base_uri,
-                                            GError ** error)
+pixbuf_from_file_with_size_data (GFile *file,
+                                 struct RsvgSizeCallbackData *cb_data,
+                                 GError ** error)
 {
     RsvgHandle *handle;
     GdkPixbuf *retval;

-    handle = rsvg_handle_new ();
-
+    handle = rsvg_handle_new_from_gfile_sync (file, 0, NULL, error);
     if (!handle) {
-        g_set_error (error, rsvg_error_quark (), 0, _("Error creating SVG reader"));
         return NULL;
     }

     rsvg_handle_set_size_callback (handle, _rsvg_size_callback, cb_data, NULL);
-    rsvg_handle_set_base_uri (handle, base_uri);
-
-    if (!rsvg_handle_write (handle, (guchar *) data, data_len, error)) {
-        (void) rsvg_handle_close (handle, NULL);
-        g_object_unref (handle);
-        return NULL;
-    }
-
-    if (!rsvg_handle_close (handle, error)) {
-        g_object_unref (handle);
-        return NULL;
-    }

     retval = rsvg_handle_get_pixbuf (handle);
     g_object_unref (handle);
@@ -84,31 +68,12 @@
                                       struct RsvgSizeCallbackData *cb_data,
                                       GError ** error)
 {
+    GFile *file;
     GdkPixbuf *pixbuf;
-    char *data;
-    gsize data_len;
-    GFile *file;
-    gchar *base_uri;

     file = g_file_new_for_path (file_name);
-    base_uri = g_file_get_uri (file);
-    if (!base_uri) {
-        g_object_unref (file);
-        return NULL;
-    }
-
-    data = _rsvg_io_acquire_data (base_uri, base_uri, NULL, &data_len, NULL, error);
-
-    if (data) {
-        pixbuf = rsvg_pixbuf_from_stdio_file_with_size_data (data, data_len,
-                                                             cb_data, base_uri, error);
-        g_free (data);
-    } else {
-        pixbuf = NULL;
-    }
-
-    g_free (base_uri);
-    g_object_unref (file);
+    pixbuf = pixbuf_from_file_with_size_data (file, cb_data, error);
+    g_clear_object (&file);

     return pixbuf;
 }


Исправлен вывод TConstd -nan

Исправлен вывод TConstd -nan

--- libs/compiler/codes.c
+++ libs/compiler/codes.c
@@ -1288,7 +1288,7 @@

 void double_to_io(universal_io *const io, const int64_t fst, const int64_t snd)
 {
-	int64_t num = (snd << 32) | fst;
+	int64_t num = (snd << 32) | (fst & 0x00000000ffffffff);
 	double numdouble;
 	memcpy(&numdouble, &num, sizeof(double));
 	uni_printf(io, " %f\n", numdouble);


Константы сдвига

Константы сдвига

--- libs/compiler/nodes.c
+++ libs/compiler/nodes.c
@@ -17,6 +17,8 @@
 #include "nodes.h"
 #include "stdio.h"

+static const size_t DISPL_TO_FLOAT = 50;
+static const size_t DISPL_TO_VOID = 200;

 node_t token_to_node(const token_t token)
 {
@@ -132,7 +134,7 @@
 		|| (node >= ND_ASSIGNR && node <= ND_DIVASSIGNATR)
 		|| (node >= ND_POSTINCR && node <= ND_PREDECATR))
 	{
-		return node + 200;
+		return node + DISPL_TO_VOID;
 	}
 	else
 	{
@@ -146,7 +148,7 @@
 		|| (node >= ND_ASSIGNAT && node <= ND_DIVASSIGNAT)
 		|| (node >= ND_EQ && node <= ND_UNMINUS))
 	{
-		return node + 50;
+		return node + DISPL_TO_FLOAT;
 	}
 	else
 	{


Add fallback during garbage collection in case heap is low.

--- libs/ffs/src/ffs_gc.c
+++ libs/ffs/src/ffs_gc.c
@@ -83,6 +83,61 @@
 }

 static int
+ffs_gc_block_chain_low_mem(struct ffs_hash_entry *last_entry,
+                           uint32_t data_len, uint8_t to_area_idx)
+{
+    struct ffs_hash_entry *entry;
+    struct ffs_area *to_area;
+    struct ffs_block block;
+    uint32_t from_area_offset;
+    uint32_t bytes_copied;
+    uint16_t copy_len;
+    uint8_t from_area_idx;
+    int rc;
+
+    to_area = ffs_areas + to_area_idx;
+
+    bytes_copied = 0;
+    entry = last_entry;
+
+    while (bytes_copied < data_len) {
+        assert(entry != NULL);
+
+        rc = ffs_block_from_hash_entry(&block, entry);
+        if (rc != 0) {
+            return rc;
+        }
+
+        ffs_flash_loc_expand(&from_area_idx, &from_area_offset,
+                             block.fb_flash_loc);
+
+        copy_len = sizeof (struct ffs_disk_block) + block.fb_data_len;
+        rc = ffs_flash_copy(from_area_idx, from_area_offset, to_area_idx,
+                            to_area->fa_cur, copy_len);
+        if (rc != 0) {
+            return rc;
+        }
+        bytes_copied += block.fb_data_len;
+
+        entry = block.fb_prev;
+    }
+
+    return 0;
+}
+
+/**
+ * Moves a chain of blocks from one area to another.  This function attempts to
+ * collate the blocks into a single new block in the destination area.  If
+ * there is insufficient heap memory do to this, the function falls back to
+ * copying each block separately.
+ *
+ * @param last_entry            The last block entry in the chain.
+ * @param data_len              The total length of data to collate.
+ * @param to_area_idx           The index of the area to copy to.
+ *
+ * @param                       0 on success; nonzero on failure.
+ */
+static int
 ffs_gc_block_chain(struct ffs_hash_entry *last_entry,
                    uint32_t data_len, uint8_t to_area_idx)
 {
@@ -99,8 +154,8 @@

     data = os_malloc(data_len);
     if (data == NULL) {
-        /* XXX Fall back to single copy. */
-        rc = FFS_ENOMEM;
+        /* Not enough memory; just copy each block separately. */
+        rc = ffs_gc_block_chain_low_mem(last_entry, data_len, to_area_idx);
         goto done;
     }


Non floating objects from fake constructors (Clutter.EffectTemplate._new) were getting an extra reference.

svn path=/trunk/; revision=361

--- libseed/seed-engine.c
+++ libseed/seed-engine.c
@@ -30,8 +30,6 @@
 JSClassRef seed_struct_constructor_class;

 JSContextGroupRef context_group;
-
-GParamSpec **global_prop_cache;

 gchar *glib_message = 0;

@@ -356,6 +354,7 @@
 		{
 			GIBaseInfo *interface;
 			GIInfoType type;
+			gboolean sunk = TRUE;

 			if (tag == GI_TYPE_TAG_INTERFACE)
 			{
@@ -375,13 +374,20 @@
 						interface_type == GI_INFO_TYPE_INTERFACE)
 					{
 						if (G_IS_OBJECT(retval.v_pointer))
+						{
+							sunk =
+							g_object_is_floating(G_OBJECT(retval.v_pointer));
 							g_object_ref_sink(G_OBJECT(retval.v_pointer));
+						}
 					}

 				}
 			}
 			retval_ref =
 				seed_gi_argument_make_js(ctx, &retval, type_info, exception);
+
+			if (!sunk)
+				g_object_unref(G_OBJECT(retval.v_pointer));

 			seed_gi_release_arg(
 				g_callable_info_get_caller_owns((GICallableInfo*) info),


soup_cookie_new: clarify the interpretation of @domain

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

--- libsoup/soup-cookie.c
+++ libsoup/soup-cookie.c
@@ -358,6 +358,10 @@
  * soup_cookie_set_secure() and soup_cookie_set_http_only() if you
  * need to set those attributes on the returned cookie.)
  *
+ * If @domain starts with ".", that indicates a domain (which matches
+ * the string after the ".", or any hostname that has @domain as a
+ * suffix). Otherwise, it is a hostname and must match exactly.
+ *
  * @max_age is used to set the "expires" attribute on the cookie; pass
  * -1 to not include the attribute (indicating that the cookie expires
  * with the current session), 0 for an already-expired cookie, or a


libxkutil: More meaningful log message

libxkutil: More meaningful log message

Signed-off-by: Eduardo Lima (Etrunko) <62d34c03f1c79cee129ea3245d580303ab09f27f@br.ibm.com>

--- libxkutil/misc_util.c
+++ libxkutil/misc_util.c
@@ -73,14 +73,14 @@

         ret = config_read_file(&conf, LIBVIRTCIM_CONF);
         if (ret == CONFIG_FALSE) {
-                CU_DEBUG("Error reading config file at liine %d: '%s'\n",
+                CU_DEBUG("Error reading config file at line %d: '%s'\n",
                          conf.error_line, conf.error_text);
                 goto out;
         }

         ret = config_lookup_bool(&conf, readonly_str, &readonly);
         if (ret == CONFIG_FALSE) {
-                CU_DEBUG("Error: '%s' not found in config file\n",
+                CU_DEBUG("'%s' not found in config file, assuming false\n",
                          readonly_str);
                 goto out;
         }


Fix offset types

Fix offset types

--- ligra/edgeMap_utils.h
+++ ligra/edgeMap_utils.h
@@ -42,7 +42,7 @@
 template <typename data, typename std::enable_if<
   std::is_same<data, pbbs::empty>::value, int>::type=0 >
 auto get_emsparse_gen(tuple<uintE, data>* outEdges) {
-  return [&] (uintE ngh, uintE offset, bool m=false) {
+  return [&] (uintE ngh, uintT offset, bool m=false) {
     if (m) {
       outEdges[offset] = make_tuple(ngh, pbbs::empty());
     } else {
@@ -54,7 +54,7 @@
 template <typename data, typename std::enable_if<
   !std::is_same<data, pbbs::empty>::value, int>::type=0 >
 auto get_emsparse_gen(tuple<uintE, data>* outEdges) {
-  return [&] (uintE ngh, uintE offset, Maybe<data> m=Maybe<data>()) {
+  return [&] (uintE ngh, uintT offset, Maybe<data> m=Maybe<data>()) {
     if (m.exists) {
       outEdges[offset] = make_tuple(ngh, m.t);
     } else {
@@ -69,7 +69,7 @@
 template <typename data, typename std::enable_if<
   std::is_same<data, pbbs::empty>::value, int>::type=0 >
 auto get_emsparse_no_filter_gen(tuple<uintE, data>* outEdges) {
-  return [&] (uintE ngh, uintE offset, bool m=false) {
+  return [&] (uintE ngh, uintT offset, bool m=false) {
     if (m) {
       outEdges[offset] = make_tuple(ngh, pbbs::empty());
       return true;
@@ -81,7 +81,7 @@
 template <typename data, typename std::enable_if<
   !std::is_same<data, pbbs::empty>::value, int>::type=0 >
 auto get_emsparse_no_filter_gen(tuple<uintE, data>* outEdges) {
-  return [&] (uintE ngh, uintE offset, Maybe<data> m=Maybe<data>()) {
+  return [&] (uintE ngh, uintT offset, Maybe<data> m=Maybe<data>()) {
     if (m.exists) {
       outEdges[offset] = make_tuple(ngh, m.t);
       return true;
@@ -97,13 +97,13 @@
 template <typename data, typename std::enable_if<
   std::is_same<data, pbbs::empty>::value, int>::type=0 >
 auto get_emsparse_nooutput_gen() {
-  return [&] (uintE ngh, uintE offset, bool m=false) { };
+  return [&] (uintE ngh, uintT offset, bool m=false) { };
 }

 template <typename data, typename std::enable_if<
   !std::is_same<data, pbbs::empty>::value, int>::type=0 >
 auto get_emsparse_nooutput_gen() {
-  return [&] (uintE ngh, uintE offset, Maybe<data> m=Maybe<data>()) { };
+  return [&] (uintE ngh, uintT offset, Maybe<data> m=Maybe<data>()) { };
 }

 template <typename data, typename std::enable_if<


Fix incorrect propcall paranoid error message

--- src-input/duk_js_call.c
+++ src-input/duk_js_call.c
@@ -2806,8 +2806,8 @@

 #if defined(DUK_USE_PARANOID_ERRORS)
 	str1 = duk_get_type_name(thr, -1);
-	str2 = duk_get_type_name(thr, -3);
-	str3 = duk_get_type_name(thr, -5);
+	str2 = duk_get_type_name(thr, -2);
+	str3 = duk_get_type_name(thr, -3);
 	duk_push_error_object(thr, DUK_ERR_TYPE_ERROR | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, "%s not callable (property %s of %s)", str1, str2, str3);
 #else
 	str1 = duk_push_string_readable(thr, -1);


Whitespace corrections.

Whitespace corrections.

--- src/via_driver.c
+++ src/via_driver.c
@@ -442,7 +442,8 @@

 #endif /* XFree86LOADER */

-static Bool VIAGetRec(ScrnInfoPtr pScrn)
+static Bool
+VIAGetRec(ScrnInfoPtr pScrn)
 {
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetRec\n"));
     if (pScrn->driverPrivate)
@@ -482,22 +483,22 @@
 } /* VIAFreeRec */

-
-static const OptionInfoRec * VIAAvailableOptions(int chipid, int busid)
-{
-
+static const
+OptionInfoRec * VIAAvailableOptions(int chipid, int busid)
+{
     return VIAOptions;
-
-} /* VIAAvailableOptions */
-
-
-static void VIAIdentify(int flags)
+}
+
+
+static void
+VIAIdentify(int flags)
 {
     xf86PrintChipsets("OPENCHROME", "Driver for VIA Chrome chipsets",
                       VIAChipsets);
-} /* VIAIdentify */
-
-static Bool VIAProbe(DriverPtr drv, int flags)
+}
+
+static Bool
+VIAProbe(DriverPtr drv, int flags)
 {
     GDevPtr *devSections;
     int     *usedChips;
@@ -609,7 +610,8 @@
 } /* VIAProbe */

 #ifdef XF86DRI
-static void kickVblank(ScrnInfoPtr pScrn)
+static void
+kickVblank(ScrnInfoPtr pScrn)
 {
     /*
      * Switching mode will clear registers that make vblank
@@ -628,7 +630,8 @@
 }
 #endif

-static int LookupChipSet(PciChipsets *pset, int chipSet)
+static int
+LookupChipSet(PciChipsets *pset, int chipSet)
 {
   while (pset->numChipset >= 0) {
     if (pset->numChipset == chipSet) return pset->PCIid;
@@ -642,8 +645,7 @@
 LookupChipID(PciChipsets* pset, int ChipID)
 {
     /* Is there a function to do this for me? */
-    while (pset->numChipset >= 0)
-    {
+    while (pset->numChipset >= 0) {
         if (pset->PCIid == ChipID)
             return pset->numChipset;

@@ -651,8 +653,7 @@
     }

     return -1;
-
-} /* LookupChipID */
+}

 static void
 VIAProbeDDC(ScrnInfoPtr pScrn, int index)
@@ -698,12 +699,11 @@
 #ifdef HAVE_DEBUG
     pVia->PrintVGARegs = FALSE;
 #endif
-    pVia->swov.maxWInterp = 800 ;
-    pVia->swov.maxHInterp = 600 ;
+    pVia->swov.maxWInterp = 800;
+    pVia->swov.maxHInterp = 600;
     pVia->useLegacyVBE = TRUE;

-    switch (pVia->Chipset)
-    {
+    switch (pVia->Chipset) {
         case VIA_KM400:
             /* IRQ is not broken on KM400A */
             /* But test below is not enough to make sure we have a KM400A */
@@ -725,8 +725,8 @@
 	case VIA_PM800:
 	case VIA_CX700:
             pVia->VideoEngine = VIDEO_ENGINE_CME;
-            pVia->swov.maxWInterp = 1920 ;
-            pVia->swov.maxHInterp = 1080 ;
+            pVia->swov.maxWInterp = 1920;
+            pVia->swov.maxHInterp = 1080;
 	    break;
 	case VIA_P4M890:
             pVia->VideoEngine = VIDEO_ENGINE_CME;
@@ -1459,8 +1459,7 @@
     if (!xf86LoadSubModule(pScrn, "i2c")) {
         VIAFreeRec(pScrn);
         return FALSE;
-    }
-    else {
+    } else {
         xf86LoaderReqSymLists(i2cSymbols,NULL);
         ViaI2CInit(pScrn);
     }
@@ -1879,8 +1878,7 @@
         Regs->SR46 = hwp->readSeq(hwp, 0x46);
         Regs->SR47 = hwp->readSeq(hwp, 0x47);

-        switch (pVia->Chipset)
-        {
+        switch (pVia->Chipset) {
             case VIA_CLE266:
             case VIA_KM400:
                 break;
@@ -1988,8 +1986,7 @@
     hwp->writeSeq(hwp, 0x46, Regs->SR46);
     hwp->writeSeq(hwp, 0x47, Regs->SR47);

-    switch (pVia->Chipset)
-    {
+    switch (pVia->Chipset) {
         case VIA_CLE266:
         case VIA_KM400:
             break;
@@ -2322,9 +2319,6 @@
     }
 }

-/*
- *
- */
 static Bool
 VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 {
@@ -2670,7 +2664,6 @@
 #endif
         /* Wait Hardware Engine idle to exit graphical mode */
         viaAccelSync(pScrn);
-

 	/* A soft reset Fixes 3D Hang after X restart */
         if (pVia->Chipset != VIA_K8M890 && pVia->Chipset != VIA_P4M900)
@@ -2873,43 +2866,27 @@
     int i;

     VIASETREG(VIA_REG_TRANSET, 0x00010000);
-
     for (i = 0; i <= 0x7D; i++)
-      {
 	VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24);
-      }

     VIASETREG(VIA_REG_TRANSET, 0x00020000);
-
     for (i = 0; i <= 0x94; i++)
-      {
 	VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24);
-      }
-
     VIASETREG(VIA_REG_TRANSPACE, 0x82400000);

     VIASETREG(VIA_REG_TRANSET, 0x01020000);
-
-
     for (i = 0; i <= 0x94; i++)
-      {
 	VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24);
-      }
-
     VIASETREG(VIA_REG_TRANSPACE, 0x82400000);
+
     VIASETREG(VIA_REG_TRANSET, 0xfe020000);
-
     for (i = 0; i <= 0x03; i++)
-      {
 	VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24);
-      }

     VIASETREG(VIA_REG_TRANSET, 0x00030000);
-
     for (i = 0; i <= 0xff; i++)
-      {
 	VIASETREG(VIA_REG_TRANSPACE, 0);
-      }
+
     VIASETREG(VIA_REG_TRANSET, 0x00100000);
     VIASETREG(VIA_REG_TRANSPACE, 0x00333004);
     VIASETREG(VIA_REG_TRANSPACE, 0x10000002);
@@ -2920,12 +2897,10 @@
     VIASETREG(VIA_REG_TRANSPACE, 0x64000000);

     VIASETREG(VIA_REG_TRANSET, 0x00fe0000);
-
     if (pVia->ChipRev >= 3 )
-      VIASETREG(VIA_REG_TRANSPACE,0x40008c0f);
+        VIASETREG(VIA_REG_TRANSPACE,0x40008c0f);
     else
-      VIASETREG(VIA_REG_TRANSPACE,0x4000800f);
-
+        VIASETREG(VIA_REG_TRANSPACE,0x4000800f);
     VIASETREG(VIA_REG_TRANSPACE,0x44000000);
     VIASETREG(VIA_REG_TRANSPACE,0x45080C04);
     VIASETREG(VIA_REG_TRANSPACE,0x46800408);
@@ -2933,7 +2908,6 @@
     VIASETREG(VIA_REG_TRANSPACE,0x51000000);
     VIASETREG(VIA_REG_TRANSPACE,0x52000000);
     VIASETREG(VIA_REG_TRANSPACE,0x53000000);
-

     VIASETREG(VIA_REG_TRANSET,0x00fe0000);
     VIASETREG(VIA_REG_TRANSPACE,0x08000001);


minor typo

minor typo

--- src/via_driver.c
+++ src/via_driver.c
@@ -1215,7 +1215,7 @@
             } else {
                 from = X_DEFAULT;
                 xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-                           "No memory-detection done.  Use VideoRAM option.\n");
+                           "No memory-detection done. Use VideoRAM option.\n");
             }
     }