From fff9bc3b102e3e38cbd2b53945aa18c4739a27b2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 6 Jun 2011 17:40:41 +0100 Subject: [PATCH 4/4] dbus-marshal-recursive: make some internal functions static Having a disabled type writer, comparing type readers by position, and performing a single step of copying from a reader to a writer all seem pretty obscure, and were only used within dbus-marshal-recursive.c (to realign after insertion). --- dbus/dbus-marshal-recursive.c | 24 ++++++++++++++++++------ dbus/dbus-marshal-recursive.h | 10 ---------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/dbus/dbus-marshal-recursive.c b/dbus/dbus-marshal-recursive.c index cb10854..4adfd2e 100644 --- a/dbus/dbus-marshal-recursive.c +++ b/dbus/dbus-marshal-recursive.c @@ -32,6 +32,18 @@ * @{ */ +static dbus_bool_t _dbus_type_reader_greater_than (const DBusTypeReader *lhs, + const DBusTypeReader *rhs); + +static void _dbus_type_writer_set_enabled (DBusTypeWriter *writer, + dbus_bool_t enabled); +static dbus_bool_t _dbus_type_writer_write_reader_partial (DBusTypeWriter *writer, + DBusTypeReader *reader, + const DBusTypeReader *start_after, + int start_after_new_pos, + int start_after_new_len, + DBusList **fixups); + /** turn this on to get deluged in TypeReader verbose spam */ #define RECURSIVE_MARSHAL_READ_TRACE 0 @@ -1428,7 +1440,7 @@ _dbus_type_reader_delete (DBusTypeReader *reader, return retval; } -/** +/* * Compares two readers, which must be iterating over the same value data. * Returns #TRUE if the first parameter is further along than the second parameter. * @@ -1436,7 +1448,7 @@ _dbus_type_reader_delete (DBusTypeReader *reader, * @param rhs left-hand-side (first) parameter * @returns whether lhs is greater than rhs */ -dbus_bool_t +static dbus_bool_t _dbus_type_reader_greater_than (const DBusTypeReader *lhs, const DBusTypeReader *rhs) { @@ -2627,7 +2639,7 @@ writer_write_reader_helper (DBusTypeWriter *writer, return FALSE; } -/** +/* * Iterate through all values in the given reader, writing a copy of * each value to the writer. The reader will be moved forward to its * end position. @@ -2658,7 +2670,7 @@ writer_write_reader_helper (DBusTypeWriter *writer, * @param fixups list to append #DBusArrayLenFixup if the write was partial * @returns #FALSE if no memory */ -dbus_bool_t +static dbus_bool_t _dbus_type_writer_write_reader_partial (DBusTypeWriter *writer, DBusTypeReader *reader, const DBusTypeReader *start_after, @@ -2719,7 +2731,7 @@ _dbus_type_writer_write_reader (DBusTypeWriter *writer, return _dbus_type_writer_write_reader_partial (writer, reader, NULL, 0, 0, NULL); } -/** +/* * If disabled, a writer can still be iterated forward and recursed/unrecursed * but won't write any values. Types will still be written unless the * writer is a "values only" writer, because the writer needs access to @@ -2728,7 +2740,7 @@ _dbus_type_writer_write_reader (DBusTypeWriter *writer, * @param writer the type writer * @param enabled #TRUE if values should be written */ -void +static void _dbus_type_writer_set_enabled (DBusTypeWriter *writer, dbus_bool_t enabled) { diff --git a/dbus/dbus-marshal-recursive.h b/dbus/dbus-marshal-recursive.h index 97e5466..acbfd73 100644 --- a/dbus/dbus-marshal-recursive.h +++ b/dbus/dbus-marshal-recursive.h @@ -129,8 +129,6 @@ dbus_bool_t _dbus_type_reader_set_basic (DBusTypeReader * const DBusTypeReader *realign_root); dbus_bool_t _dbus_type_reader_delete (DBusTypeReader *reader, const DBusTypeReader *realign_root); -dbus_bool_t _dbus_type_reader_greater_than (const DBusTypeReader *lhs, - const DBusTypeReader *rhs); dbus_bool_t _dbus_type_reader_equal_values (const DBusTypeReader *lhs, const DBusTypeReader *rhs); @@ -178,14 +176,6 @@ dbus_bool_t _dbus_type_writer_append_array (DBusTypeWriter *write DBusTypeWriter *sub); dbus_bool_t _dbus_type_writer_write_reader (DBusTypeWriter *writer, DBusTypeReader *reader); -dbus_bool_t _dbus_type_writer_write_reader_partial (DBusTypeWriter *writer, - DBusTypeReader *reader, - const DBusTypeReader *start_after, - int start_after_new_pos, - int start_after_new_len, - DBusList **fixups); -void _dbus_type_writer_set_enabled (DBusTypeWriter *writer, - dbus_bool_t enabled); #endif /* DBUS_MARSHAL_RECURSIVE_H */ -- 1.7.5.4