Hardcoded FIELD_REPLY_SERIAL in append_{,u}int_field ()

Miloslav Trmac mitr@volny.cz
Sat, 28 Jun 2003 05:02:57 +0200


--1LKvkjL3sHcu1TtY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,
append_{,u}int_field () in dbus/dbus-message.c currently reference
the header field both by [FIELD_REPLY_SERIAL] and by [field].
Due to the way they are called, this currently causes no problems.
Anyway, either the "field" parameter is redundant, or FIELD_REPLY_SERIAL
should be replaced by field. Attached patch does the latter.
	Mirek

--1LKvkjL3sHcu1TtY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-field

diff -ur dbus/dbus/dbus-message.c sw/dbus/dbus/dbus-message.c
--- dbus/dbus/dbus-message.c	2003-06-28 01:16:52.000000000 +0200
+++ sw/dbus/dbus/dbus-message.c	2003-06-28 02:58:56.000000000 +0200
@@ -307,7 +307,7 @@
   if (!_dbus_string_align_length (&message->header, 4))
     goto failed;
   
-  message->header_fields[FIELD_REPLY_SERIAL].offset =
+  message->header_fields[field].offset =
     _dbus_string_get_length (&message->header);
   
   if (!_dbus_marshal_int32 (&message->header, message->byte_order,
@@ -358,7 +358,7 @@
   if (!_dbus_string_align_length (&message->header, 4))
     goto failed;
   
-  message->header_fields[FIELD_REPLY_SERIAL].offset =
+  message->header_fields[field].offset =
     _dbus_string_get_length (&message->header);
   
   if (!_dbus_marshal_uint32 (&message->header, message->byte_order,

--1LKvkjL3sHcu1TtY--