Replace deprecated glib functions.

In order to compile the whole project with -DG_DISABLE_DEPRECATED
the mate plugin needs to replace its usage of GMemChunk.
All other places should be clean.

svn path=/trunk/; revision=38392
This commit is contained in:
Jörg Mayer 2011-08-07 18:15:45 +00:00
parent 9e61dfeb33
commit c15ff441c6
5 changed files with 13 additions and 11 deletions

View File

@ -2892,15 +2892,17 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
if (global_capture_opts.ifaces->len > 1) {
prefix = g_strdup_printf("wireshark_%d_interfaces", global_capture_opts.ifaces->len);
} else {
gchar *basename;
#ifdef _WIN32
GString *iface;
iface = isolate_uuid(g_array_index(global_capture_opts.ifaces, interface_options, 0).name);
prefix = g_strconcat("wireshark_", g_basename(iface->str), NULL);
basename = g_path_get_basename(iface->str);
g_string_free(iface, TRUE);
#else
prefix = g_strconcat("wireshark_", g_basename(g_array_index(global_capture_opts.ifaces, interface_options, 0).name), NULL);
basename = g_path_get_basename(g_array_index(global_capture_opts.ifaces, interface_options, 0).name);
#endif
prefix = g_strconcat("wireshark_", basename, NULL);
g_free(basename);
}
*save_file_fd = create_tempfile(&tmpname, prefix);
g_free(prefix);

View File

@ -1824,7 +1824,7 @@ parse_key_string(gchar* input_string, guint8 key_type)
/* XXX - The current key handling code in the GUI requires
* no separators and lower case */
dk->key = g_string_new(bytes_to_str(key_ba->data, key_ba->len));
g_string_down(dk->key);
g_string_ascii_down(dk->key);
dk->bits = key_ba->len * 8;
dk->ssid = NULL;

View File

@ -395,13 +395,13 @@ void add_tlv(const gchar* name, const gchar* codestr, radius_attr_dissector_t t
a = g_hash_table_lookup(dict->attrs_by_name, current_attr);
if (! a) {
g_string_sprintfa(error, "Attr: '%s', does not exist in %s:%i \n", current_attr, fullpaths[include_stack_ptr], linenums[include_stack_ptr]);
g_string_append_printf(error, "Attr: '%s', does not exist in %s:%i \n", current_attr, fullpaths[include_stack_ptr], linenums[include_stack_ptr]);
BEGIN JUNK;
return;
}
if (type == radius_tlv) {
g_string_sprintfa(error, "sub-TLV: '%s', sub-TLV's type is specified as tlv in %s:%i \n", name, fullpaths[include_stack_ptr], linenums[include_stack_ptr]);
g_string_append_printf(error, "sub-TLV: '%s', sub-TLV's type is specified as tlv in %s:%i \n", name, fullpaths[include_stack_ptr], linenums[include_stack_ptr]);
BEGIN JUNK;
return;
}

View File

@ -1068,7 +1068,7 @@ WSLUA_CONSTRUCTOR Proto_new(lua_State* L) {
if ( name ) {
gchar* loname_a = ep_strdup(name);
g_strdown(loname_a);
g_ascii_strdown(loname_a, -1);
if ( proto_get_id_by_filter_name(loname_a) > 0 ) {
WSLUA_ARG_ERROR(Proto_new,NAME,"there cannot be two protocols with the same name");
} else {
@ -1076,8 +1076,8 @@ WSLUA_CONSTRUCTOR Proto_new(lua_State* L) {
gchar* loname = g_strdup(name);
gchar* hiname = g_strdup(name);
g_strdown(loname);
g_strup(hiname);
g_ascii_strdown(loname, -1);
g_ascii_strup(hiname, -1);
proto->name = hiname;
proto->desc = g_strdup(desc);
@ -1164,7 +1164,7 @@ static int Proto_set_dissector(lua_State* L) {
if (lua_isfunction(L,3)) {
/* insert the dissector into the dissectors table */
gchar* loname = ep_strdup(proto->name);
g_strdown(loname);
g_ascii_strdown(loname, -1);
lua_rawgeti(L, LUA_REGISTRYINDEX, lua_dissectors_table_ref);
lua_replace(L, 1);

View File

@ -132,7 +132,7 @@ static gchar* recolonize(mate_config* mc, gchar* s) {
vec = g_strsplit(s,":",0);
for (i = 0; vec[i]; i++) {
g_strdown(vec[i]);
g_ascii_strdown(vec[i]);
v = 0;
switch ( strlen(vec[i]) ) {