Replace deprecated glib functions.
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 7 Aug 2011 18:15:45 +0000 (18:15 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 7 Aug 2011 18:15:45 +0000 (18:15 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38392 f5534014-38df-0310-8fa8-9805f1628bb7

dumpcap.c
epan/crypt/airpdcap.c
epan/radius_dict.l
epan/wslua/wslua_proto.c
plugins/mate/mate_grammar.lemon

index a86daef3d58721ec955615654da1ef11dcdfdce0..319c419507b68462ba83ec052fabef470e4c702d 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -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);
index c96a2a2a29e3471221e09192481fbb59dcf073f2..740a148c8bbc858bfe9271c906000f516924d757 100644 (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;
 
index 75a0ed1bddbe40a08066fb0c2b9c3480c3b07631..d2780d745c2b0c9ecee5e9ab005aa07236569080 100644 (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;
        }
index e4f32b52d8613087235f146cc788ead4beb025f4..298ac613f694f66f242342c8df4789cfcbf90114 100644 (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);
index 2afa8dec2dcb368b653b7183513740de26d9b55c..f6236ba766d6cc0e8d3c9d5fa3bc4b7731784f52 100644 (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]) ) {