Commit fa05de92 authored by Havoc Pennington's avatar Havoc Pennington

2003-03-31 Havoc Pennington <hp@redhat.com>

        Fix some annoying DBusString API and fix all affected code.

	* dbus/dbus-string.c (_dbus_string_init): get rid of annoying
	max_length argument
	(_dbus_string_get_data): change to return string instead of using
	an out param
	(_dbus_string_get_const_data): ditto
	(_dbus_string_get_data_len): ditto
	(_dbus_string_get_const_data_len): ditto
parent 7af59334
2003-03-31 Havoc Pennington <hp@redhat.com>
Fix some annoying DBusString API and fix all affected code.
* dbus/dbus-string.c (_dbus_string_init): get rid of annoying
max_length argument
(_dbus_string_get_data): change to return string instead of using
an out param
(_dbus_string_get_const_data): ditto
(_dbus_string_get_data_len): ditto
(_dbus_string_get_const_data_len): ditto
2003-03-31 Havoc Pennington <hp@redhat.com>
* bus/main.c (main): fix up the command line arguments to be nicer
......
......@@ -204,13 +204,13 @@ load_directory (BusActivation *activation,
iter = NULL;
desktop_file = NULL;
if (!_dbus_string_init (&filename, _DBUS_INT_MAX))
if (!_dbus_string_init (&filename))
{
BUS_SET_OOM (error);
return FALSE;
}
if (!_dbus_string_init (&full_path, _DBUS_INT_MAX))
if (!_dbus_string_init (&full_path))
{
BUS_SET_OOM (error);
_dbus_string_free (&filename);
......@@ -244,10 +244,8 @@ load_directory (BusActivation *activation,
if (!_dbus_string_ends_with_c_str (&filename, ".service"))
{
const char *filename_c;
_dbus_string_get_const_data (&filename, &filename_c);
_dbus_verbose ("Skipping non-.service file %s\n",
filename_c);
_dbus_string_get_const_data (&filename));
continue;
}
......@@ -255,11 +253,8 @@ load_directory (BusActivation *activation,
if (desktop_file == NULL)
{
const char *full_path_c;
_dbus_string_get_const_data (&full_path, &full_path_c);
_dbus_verbose ("Could not load %s: %s\n", full_path_c,
_dbus_verbose ("Could not load %s: %s\n",
_dbus_string_get_const_data (&full_path),
tmp_error.message);
if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
......@@ -274,15 +269,11 @@ load_directory (BusActivation *activation,
if (!add_desktop_file_entry (activation, desktop_file, &tmp_error))
{
const char *full_path_c;
bus_desktop_file_free (desktop_file);
desktop_file = NULL;
_dbus_string_get_const_data (&full_path, &full_path_c);
_dbus_verbose ("Could not add %s to activation entry list: %s\n",
full_path_c, tmp_error.message);
_dbus_string_get_const_data (&full_path), tmp_error.message);
if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
{
......
......@@ -184,7 +184,7 @@ bus_context_new (const DBusString *config_file,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
if (!_dbus_string_init (&full_address, _DBUS_INT_MAX))
if (!_dbus_string_init (&full_address))
return NULL;
parser = NULL;
......
......@@ -178,9 +178,9 @@ bus_config_load (const DBusString *file,
context.error = error;
context.failed = FALSE;
_dbus_string_get_const_data (file, &filename);
filename = _dbus_string_get_const_data (file);
if (!_dbus_string_init (&context.content, _DBUS_INT_MAX))
if (!_dbus_string_init (&context.content))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
return NULL;
......@@ -212,7 +212,7 @@ bus_config_load (const DBusString *file,
DBusString data;
const char *data_str;
if (!_dbus_string_init (&data, _DBUS_INT_MAX))
if (!_dbus_string_init (&data))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
goto failed;
......@@ -224,7 +224,7 @@ bus_config_load (const DBusString *file,
goto failed;
}
_dbus_string_get_const_data (&data, &data_str);
data_str = _dbus_string_get_const_data (&data);
if (!XML_Parse (expat, data_str, _dbus_string_get_length (&data), TRUE))
{
......
......@@ -941,7 +941,7 @@ process_test_subdir (const DBusString *test_base_dir,
retval = FALSE;
dir = NULL;
if (!_dbus_string_init (&test_directory, _DBUS_INT_MAX))
if (!_dbus_string_init (&test_directory))
_dbus_assert_not_reached ("didn't allocate test_directory\n");
_dbus_string_init_const (&filename, subdir);
......@@ -954,16 +954,15 @@ process_test_subdir (const DBusString *test_base_dir,
_dbus_assert_not_reached ("couldn't allocate full path");
_dbus_string_free (&filename);
if (!_dbus_string_init (&filename, _DBUS_INT_MAX))
if (!_dbus_string_init (&filename))
_dbus_assert_not_reached ("didn't allocate filename string\n");
dbus_error_init (&error);
dir = _dbus_directory_open (&test_directory, &error);
if (dir == NULL)
{
const char *s;
_dbus_string_get_const_data (&test_directory, &s);
_dbus_warn ("Could not open %s: %s\n", s,
_dbus_warn ("Could not open %s: %s\n",
_dbus_string_get_const_data (&test_directory),
error.message);
dbus_error_free (&error);
goto failed;
......@@ -977,7 +976,7 @@ process_test_subdir (const DBusString *test_base_dir,
DBusString full_path;
LoaderOomData d;
if (!_dbus_string_init (&full_path, _DBUS_INT_MAX))
if (!_dbus_string_init (&full_path))
_dbus_assert_not_reached ("couldn't init string");
if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
......@@ -988,19 +987,13 @@ process_test_subdir (const DBusString *test_base_dir,
if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
{
const char *filename_c;
_dbus_string_get_const_data (&filename, &filename_c);
_dbus_verbose ("Skipping non-.conf file %s\n",
filename_c);
_dbus_string_get_const_data (&filename));
_dbus_string_free (&full_path);
goto next;
}
{
const char *s;
_dbus_string_get_const_data (&filename, &s);
printf (" %s\n", s);
}
printf (" %s\n", _dbus_string_get_const_data (&filename));
_dbus_verbose (" expecting %s\n",
validity == VALID ? "valid" :
......@@ -1017,10 +1010,9 @@ process_test_subdir (const DBusString *test_base_dir,
if (dbus_error_is_set (&error))
{
const char *s;
_dbus_string_get_const_data (&test_directory, &s);
_dbus_warn ("Could not get next file in %s: %s\n",
s, error.message);
_dbus_string_get_const_data (&test_directory),
error.message);
dbus_error_free (&error);
goto failed;
}
......
......@@ -732,20 +732,17 @@ dbus_bool_t
bus_connection_set_name (DBusConnection *connection,
const DBusString *name)
{
const char *c_name;
BusConnectionData *d;
d = BUS_CONNECTION_DATA (connection);
_dbus_assert (d != NULL);
_dbus_assert (d->name == NULL);
_dbus_string_get_const_data (name, &c_name);
d->name = _dbus_strdup (c_name);
if (d->name == NULL)
if (!_dbus_string_copy_data (name, &d->name))
return FALSE;
_dbus_assert (d->name != NULL);
_dbus_verbose ("Name %s assigned to %p\n", d->name, connection);
return TRUE;
......
......@@ -514,7 +514,7 @@ parse_key_value (BusDesktopFileParser *parser, DBusError *error)
return FALSE;
}
if (!_dbus_string_init (&key, key_end - key_start))
if (!_dbus_string_init (&key))
{
parser_free (parser);
return FALSE;
......@@ -613,7 +613,7 @@ bus_desktop_file_load (DBusString *filename,
return NULL;
}
if (!_dbus_string_init (&str, _DBUS_INT_MAX))
if (!_dbus_string_init (&str))
return NULL;
if (!_dbus_file_get_contents (&str, filename, error))
......
......@@ -110,7 +110,7 @@ send_service_nonexistent_error (BusTransaction *transaction,
* bounce back an error message.
*/
if (!_dbus_string_init (&error_message, _DBUS_INT_MAX))
if (!_dbus_string_init (&error_message))
{
BUS_SET_OOM (error);
return FALSE;
......@@ -125,7 +125,7 @@ send_service_nonexistent_error (BusTransaction *transaction,
return FALSE;
}
_dbus_string_get_const_data (&error_message, &error_str);
error_str = _dbus_string_get_const_data (&error_message);
error_reply = dbus_message_new_error_reply (in_reply_to,
DBUS_ERROR_SERVICE_DOES_NOT_EXIST,
error_str);
......
......@@ -278,7 +278,7 @@ bus_driver_handle_hello (DBusConnection *connection,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
if (!_dbus_string_init (&unique_name, _DBUS_INT_MAX))
if (!_dbus_string_init (&unique_name))
{
BUS_SET_OOM (error);
return FALSE;
......
......@@ -51,10 +51,8 @@ check_two_config_files (const DBusString *config_file,
{
if (_dbus_string_get_length (config_file) > 0)
{
const char *s;
_dbus_string_get_const_data (config_file, &s);
fprintf (stderr, "--%s specified but configuration file %s already requested\n",
extra_arg, s);
extra_arg, _dbus_string_get_const_data (config_file));
exit (1);
}
}
......@@ -68,7 +66,7 @@ main (int argc, char **argv)
const char *prev_arg;
int i;
if (!_dbus_string_init (&config_file, _DBUS_INT_MAX))
if (!_dbus_string_init (&config_file))
return 1;
prev_arg = NULL;
......
......@@ -107,13 +107,10 @@ BusService*
bus_registry_lookup (BusRegistry *registry,
const DBusString *service_name)
{
const char *c_name;
BusService *service;
_dbus_string_get_const_data (service_name, &c_name);
service = _dbus_hash_table_lookup_string (registry->service_hash,
c_name);
_dbus_string_get_const_data (service_name));
return service;
}
......@@ -125,18 +122,15 @@ bus_registry_ensure (BusRegistry *registry,
BusTransaction *transaction,
DBusError *error)
{
const char *c_name;
BusService *service;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
_dbus_assert (owner_if_created != NULL);
_dbus_assert (transaction != NULL);
_dbus_string_get_const_data (service_name, &c_name);
service = _dbus_hash_table_lookup_string (registry->service_hash,
c_name);
_dbus_string_get_const_data (service_name));
if (service != NULL)
return service;
......@@ -149,8 +143,7 @@ bus_registry_ensure (BusRegistry *registry,
service->registry = registry;
service->name = _dbus_strdup (c_name);
if (service->name == NULL)
if (!_dbus_string_copy_data (service_name, &service->name))
{
_dbus_mem_pool_dealloc (registry->service_pool, service);
BUS_SET_OOM (error);
......
......@@ -296,7 +296,7 @@ bus_context_new_test (const DBusString *test_data_dir,
DBusString relative;
BusContext *context;
if (!_dbus_string_init (&config_file, _DBUS_INT_MAX))
if (!_dbus_string_init (&config_file))
{
_dbus_warn ("No memory\n");
return NULL;
......
......@@ -97,7 +97,7 @@ create_entry (void)
if (entry == NULL)
return NULL;
if (!_dbus_string_init (&entry->method, _DBUS_INT_MAX))
if (!_dbus_string_init (&entry->method))
{
dbus_free (entry);
return NULL;
......@@ -116,11 +116,7 @@ create_entry (void)
const char *
dbus_address_entry_get_method (DBusAddressEntry *entry)
{
const char *method;
_dbus_string_get_const_data (&entry->method, &method);
return method;
return _dbus_string_get_const_data (&entry->method);
}
/**
......@@ -144,12 +140,8 @@ dbus_address_entry_get_value (DBusAddressEntry *entry,
_dbus_assert (values != NULL);
if (_dbus_string_equal_c_str (keys->data, key))
{
const char *str;
return _dbus_string_get_const_data (values->data);
_dbus_string_get_const_data (values->data, &str);
return str;
}
keys = _dbus_list_get_next_link (&entry->keys, keys);
values = _dbus_list_get_next_link (&entry->values, values);
}
......@@ -268,7 +260,7 @@ dbus_parse_address (const char *address,
goto error;
}
if (!_dbus_string_init (key, _DBUS_INT_MAX))
if (!_dbus_string_init (key))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
dbus_free (key);
......@@ -277,7 +269,7 @@ dbus_parse_address (const char *address,
goto error;
}
if (!_dbus_string_init (value, _DBUS_INT_MAX))
if (!_dbus_string_init (value))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
_dbus_string_free (key);
......
......@@ -198,16 +198,16 @@ _dbus_auth_script_run (const DBusString *filename)
_dbus_string_init_const (&context, "org_freedesktop_test");
if (!_dbus_string_init (&file, _DBUS_INT_MAX))
if (!_dbus_string_init (&file))
return FALSE;
if (!_dbus_string_init (&line, _DBUS_INT_MAX))
if (!_dbus_string_init (&line))
{
_dbus_string_free (&file);
return FALSE;
}
if (!_dbus_string_init (&from_auth, _DBUS_INT_MAX))
if (!_dbus_string_init (&from_auth))
{
_dbus_string_free (&file);
_dbus_string_free (&line);
......@@ -216,10 +216,8 @@ _dbus_auth_script_run (const DBusString *filename)
dbus_error_init (&error);
if (!_dbus_file_get_contents (&file, filename, &error)) {
const char *s;
_dbus_string_get_const_data (filename, &s);
_dbus_warn ("Getting contents of %s failed: %s\n",
s, error.message);
_dbus_string_get_const_data (filename), error.message);
dbus_error_free (&error);
goto out;
}
......@@ -335,7 +333,7 @@ _dbus_auth_script_run (const DBusString *filename)
_dbus_string_delete_first_word (&line);
if (!_dbus_string_init (&to_send, _DBUS_INT_MAX))
if (!_dbus_string_init (&to_send))
{
_dbus_warn ("no memory to allocate string\n");
goto out;
......@@ -349,11 +347,7 @@ _dbus_auth_script_run (const DBusString *filename)
goto out;
}
{
const char *s4;
_dbus_string_get_const_data (&to_send, &s4);
_dbus_verbose ("Sending '%s'\n", s4);
}
_dbus_verbose ("Sending '%s'\n", _dbus_string_get_const_data (&to_send));
if (!_dbus_string_append (&to_send, "\r\n"))
{
......@@ -372,7 +366,7 @@ _dbus_auth_script_run (const DBusString *filename)
{
DBusString username;
if (!_dbus_string_init (&username, _DBUS_INT_MAX))
if (!_dbus_string_init (&username))
{
_dbus_warn ("no memory for userid\n");
_dbus_string_free (&to_send);
......@@ -406,7 +400,7 @@ _dbus_auth_script_run (const DBusString *filename)
DBusString username;
const DBusString *u;
if (!_dbus_string_init (&username, _DBUS_INT_MAX))
if (!_dbus_string_init (&username))
{
_dbus_warn ("no memory for username\n");
_dbus_string_free (&to_send);
......@@ -486,7 +480,7 @@ _dbus_auth_script_run (const DBusString *filename)
_dbus_string_delete_first_word (&line);
if (!_dbus_string_init (&received, _DBUS_INT_MAX))
if (!_dbus_string_init (&received))
{
_dbus_warn ("no mem to allocate string received\n");
goto out;
......@@ -494,21 +488,18 @@ _dbus_auth_script_run (const DBusString *filename)
if (!_dbus_string_pop_line (&from_auth, &received))
{
const char *command;
_dbus_string_get_const_data (&line, &command);
_dbus_warn ("no line popped from the DBusAuth being tested, expected command %s on line %d\n",
command, line_no);
_dbus_string_get_const_data (&line), line_no);
_dbus_string_free (&received);
goto out;
}
if (!same_first_word (&received, &line))
{
const char *s1, *s2;
_dbus_string_get_const_data (&line, &s1);
_dbus_string_get_const_data (&received, &s2);
_dbus_warn ("line %d expected command '%s' and got '%s'\n",
line_no, s1, s2);
line_no,
_dbus_string_get_const_data (&line),
_dbus_string_get_const_data (&received));
_dbus_string_free (&received);
goto out;
}
......@@ -523,7 +514,7 @@ _dbus_auth_script_run (const DBusString *filename)
_dbus_string_delete_first_word (&line);
if (!_dbus_string_init (&expected, _DBUS_INT_MAX))
if (!_dbus_string_init (&expected))
{
_dbus_warn ("no mem to allocate string expected\n");
goto out;
......@@ -546,11 +537,9 @@ _dbus_auth_script_run (const DBusString *filename)
}
else
{
const char *e1, *h1;
_dbus_string_get_const_data (&expected, &e1);
_dbus_string_get_const_data (unused, &h1);
_dbus_warn ("Expected unused bytes '%s' and have '%s'\n",
e1, h1);
_dbus_string_get_const_data (&expected),
_dbus_string_get_const_data (unused));
_dbus_string_free (&expected);
goto out;
}
......@@ -562,7 +551,7 @@ _dbus_auth_script_run (const DBusString *filename)
_dbus_string_delete_first_word (&line);
if (!_dbus_string_init (&expected, _DBUS_INT_MAX))
if (!_dbus_string_init (&expected))
{
_dbus_warn ("no mem to allocate string expected\n");
goto out;
......@@ -585,11 +574,9 @@ _dbus_auth_script_run (const DBusString *filename)
}
else
{
const char *e1, *h1;
_dbus_string_get_const_data (&expected, &e1);
_dbus_string_get_const_data (&from_auth, &h1);
_dbus_warn ("Expected exact string '%s' and have '%s'\n",
e1, h1);
_dbus_string_get_const_data (&expected),
_dbus_string_get_const_data (&from_auth));
_dbus_string_free (&expected);
goto out;
}
......@@ -601,10 +588,8 @@ _dbus_auth_script_run (const DBusString *filename)
parse_failed:
{
const char *s;
_dbus_string_get_const_data (&line, &s);
_dbus_warn ("couldn't process line %d \"%s\"\n",
line_no, s);
line_no, _dbus_string_get_const_data (&line));
goto out;
}
}
......@@ -618,10 +603,8 @@ _dbus_auth_script_run (const DBusString *filename)
if (_dbus_string_get_length (&from_auth) > 0)
{
const char *s;
_dbus_warn ("script did not have EXPECT_ statements for all the data received from the DBusAuth\n");
_dbus_string_get_const_data (&from_auth, &s);
_dbus_warn ("Leftover data: %s\n", s);
_dbus_warn ("Leftover data: %s\n", _dbus_string_get_const_data (&from_auth));
goto out;
}
......
This diff is collapsed.
......@@ -109,16 +109,16 @@ _dbus_keyring_new (void)
if (keyring == NULL)
goto out_0;
if (!_dbus_string_init (&keyring->directory, _DBUS_INT_MAX))
if (!_dbus_string_init (&keyring->directory))
goto out_1;
if (!_dbus_string_init (&keyring->filename, _DBUS_INT_MAX))
if (!_dbus_string_init (&keyring->filename))
goto out_2;
if (!_dbus_string_init (&keyring->filename_lock, _DBUS_INT_MAX))
if (!_dbus_string_init (&keyring->filename_lock))
goto out_3;
if (!_dbus_string_init (&keyring->username, _DBUS_INT_MAX))
if (!_dbus_string_init (&keyring->username))
goto out_4;
keyring->refcount = 1;
......@@ -280,7 +280,7 @@ add_new_key (DBusKey **keys_p,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
if (!_dbus_string_init (&bytes, _DBUS_INT_MAX))
if (!_dbus_string_init (&bytes))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
return FALSE;
......@@ -299,7 +299,7 @@ add_new_key (DBusKey **keys_p,
goto out;
}
_dbus_string_get_const_data (&bytes, (const char**) &s);
s = (const unsigned char*) _dbus_string_get_const_data (&bytes);
id = s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24);
if (id < 0)
......@@ -334,8 +334,7 @@ add_new_key (DBusKey **keys_p,
keys = new;
n_keys += 1;
if (!_dbus_string_init (&keys[n_keys-1].secret,
_DBUS_INT_MAX))
if (!_dbus_string_init (&keys[n_keys-1].secret))
{
n_keys -= 1; /* we don't want to free the one we didn't init */
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
......@@ -398,13 +397,13 @@ _dbus_keyring_reload (DBusKeyring *keyring,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
if (!_dbus_string_init (&contents, _DBUS_INT_MAX))
if (!_dbus_string_init (&contents))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
return FALSE;
}
if (!_dbus_string_init (&line, _DBUS_INT_MAX))
if (!_dbus_string_init (&line))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
_dbus_string_free (&contents);
......@@ -510,8 +509,7 @@ _dbus_keyring_reload (DBusKeyring *keyring,
keys = new;
n_keys += 1;
if (!_dbus_string_init (&keys[n_keys-1].secret,
_DBUS_INT_MAX))
if (!_dbus_string_init (&keys[n_keys-1].secret))
{
n_keys -= 1; /* we don't want to free the one we didn't init */
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
......@@ -689,7 +687,7 @@ _dbus_keyring_new_homedir (const DBusString *username,
keyring = NULL;
error_set = FALSE;
if (!_dbus_string_init (&homedir, _DBUS_INT_MAX))
if (!_dbus_string_init (&homedir))
return FALSE;
_dbus_string_init_const (&dotdir, ".dbus-keyrings");
......@@ -1022,7 +1020,7 @@ _dbus_keyring_test (void)
_dbus_string_init_const (&context, "foo bar");
_dbus_assert (!_dbus_keyring_validate_context (&context));
if (!_dbus_string_init (&context, _DBUS_INT_MAX))
if (!_dbus_string_init (&context))
_dbus_assert_not_reached ("no memory");
if (!_dbus_string_append_byte (&context, '\0'))
_dbus_assert_not_reached ("no memory");
......
......@@ -157,7 +157,7 @@ _dbus_marshal_set_int32 (DBusString *str,
_dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
byte_order == DBUS_BIG_ENDIAN);
_dbus_string_get_data_len (str, &data, offset, 4);
data = _dbus_string_get_data_len (str, offset, 4);
_dbus_pack_int32 (value, byte_order, data);
}
......@@ -183,7 +183,7 @@ _dbus_marshal_set_uint32 (DBusString *str,
_dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
byte_order == DBUS_BIG_ENDIAN);
_dbus_string_get_data_len (str, &data, offset, 4);
data = _dbus_string_get_data_len (str, offset, 4);
_dbus_pack_uint32 (value, byte_order, data);
}
......@@ -705,7 +705,7 @@ _dbus_demarshal_double (const DBusString *str,
pos = _DBUS_ALIGN_VALUE (pos, sizeof (double));
_dbus_string_get_const_data_len (str, &buffer, pos, sizeof (double));
buffer = _dbus_string_get_const_data_len (str, pos, sizeof (double));
retval = *(double *)buffer;
......@@ -807,7 +807,7 @@ _dbus_demarshal_string (const DBusString *str,
if (!retval)
return NULL;
_dbus_string_get_const_data_len (str, &data, pos, len);
data = _dbus_string_get_const_data_len (str, pos, len);
if (!data)
return NULL;
......@@ -865,7 +865,7 @@ _dbus_demarshal_byte_array (const DBusString *str,
if (!retval)
return FALSE;
_dbus_string_get_const_data_len (str, &data, pos, len);
data = _dbus_string_get_const_data_len (str, pos, len);
if (!data)
{
......@@ -1342,7 +1342,7 @@ _dbus_marshal_get_arg_end_pos (const DBusString *str,
if (pos >= _dbus_string_get_length (str))
return FALSE;
_dbus_string_get_const_data_len (str, &data, pos, 1);
data = _dbus_string_get_const_data_len (str, pos, 1);
switch (*data)
{
......@@ -1602,7 +1602,7 @@ _dbus_marshal_validate_arg (const DBusString *str,
if (pos >= _dbus_string_get_length (str))
return FALSE;
_dbus_string_get_const_data_len (str, &data, pos, 1);
data = _dbus_string_get_const_data_len (str, pos, 1);
switch (*data)
{
......@@ -1957,8 +1957,7 @@ _dbus_verbose_bytes_of_string (const DBusString *str,
len = real_len - start;
}
_dbus_string_get_const_data_len (str, &d, start, len);
d = _dbus_string_get_const_data_len (str, start, len);
_dbus_verbose_bytes (d, len);
}
......@@ -1993,7 +1992,7 @@ _dbus_marshal_test (void)
const char **our_string_array;
DBusDict *dict;
if (!_dbus_string_init (&str, _DBUS_INT_MAX))
if (!_dbus_string_init (&str))
_dbus_assert_not_reached ("failed to init string");
/* Marshal doubles */
......
......@@ -475,7 +475,7 @@ _dbus_md5_compute (const DBusString *data,
_dbus_md5_update (&context, data);
if (!_dbus_string_init (&digest, _DBUS_INT_MAX))
if (!_dbus_string_init (&digest))
return FALSE;
if (!_dbus_md5_final (&context, &digest))
......@@ -512,7 +512,7 @@ check_md5_binary (const unsigned char *input,
_dbus_string_init_const_len (&input_str, input, input_len);
_dbus_string_init_const (&expected_str, expected);