diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-08-27 11:27:47 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-08-27 11:27:47 +0000 |
commit | f343b83872aa35110003495b5ce45068b6ed10e6 (patch) | |
tree | 96c547861893508cff5fb6f72226fc21014a2253 /epan | |
parent | 58b36918643d9f94c1a032659b2c8588df8c79d3 (diff) |
squelch some compiler warnings
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19052 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-radius.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-rmcp.c | 4 | ||||
-rw-r--r-- | epan/guid-utils.c | 78 |
3 files changed, 41 insertions, 43 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 9c4c3d0f2d..f2a13a4a1e 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -992,7 +992,7 @@ extern void radius_register_avp_dissector(guint32 vendor_id, guint32 attribute_i vendor->ett = no_vendor.ett; g_hash_table_insert(dict->vendors_by_id,GUINT_TO_POINTER(vendor->code),vendor); - g_hash_table_insert(dict->vendors_by_name,vendor->name,vendor); + g_hash_table_insert(dict->vendors_by_name,(gpointer)(vendor->name),vendor); } dictionary_entry = g_hash_table_lookup(vendor->attrs_by_id,GUINT_TO_POINTER(attribute_id)); diff --git a/epan/dissectors/packet-rmcp.c b/epan/dissectors/packet-rmcp.c index 69bb81a126..e33d7e35b9 100644 --- a/epan/dissectors/packet-rmcp.c +++ b/epan/dissectors/packet-rmcp.c @@ -155,8 +155,8 @@ dissect_rmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static int dissect_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_tree *rsp_tree = NULL, *field_tree; - proto_item *ti, *tf; + proto_tree *rsp_tree = NULL/*, *field_tree*/; + proto_item *ti/*, *tf*/; tvbuff_t *next_tvb; int offset = 0; diff --git a/epan/guid-utils.c b/epan/guid-utils.c index 1b0c7dc0ed..8427c93e6f 100644 --- a/epan/guid-utils.c +++ b/epan/guid-utils.c @@ -43,6 +43,44 @@ static emem_tree_t *guid_to_name_tree = NULL; +#ifdef _WIN32 +/* try to resolve an DCE/RPC interface name to it's name using the Windows registry entries */ +/* XXX - might be better to fill all interfaces into our database at startup instead of searching each time */ +int +ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len) +{ + TCHAR *reg_uuid_name; + HKEY hKey = NULL; + DWORD uuid_max_size = MAX_PATH; + TCHAR *reg_uuid_str; + + reg_uuid_name=ep_alloc(MAX_PATH*sizeof(TCHAR)); + reg_uuid_str=ep_alloc(MAX_PATH*sizeof(TCHAR)); + + if(uuid_name_max_len < 2){ + return 0; + } + reg_uuid_name[0] = '\0'; + _snwprintf(reg_uuid_str, MAX_PATH, _T("SOFTWARE\\Classes\\Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"), + if_id.data1, if_id.data2, if_id.data3, + if_id.data4[0], if_id.data4[1], + if_id.data4[2], if_id.data4[3], + if_id.data4[4], if_id.data4[5], + if_id.data4[6], if_id.data4[7]); + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_uuid_str, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { + if (RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)reg_uuid_name, &uuid_max_size) == ERROR_SUCCESS && uuid_max_size <= MAX_PATH) { + g_snprintf(uuid_name, uuid_name_max_len, "%s", utf_16to8(reg_uuid_name)); + RegCloseKey(hKey); + return strlen(uuid_name); + } + RegCloseKey(hKey); + } + return 0; /* we didn't find anything anyhow. Please don't use the string! */ + +} +#endif + + /* store a guid to name mapping */ void guids_add_guid(e_guid_t *guid, const gchar *name) @@ -142,46 +180,6 @@ guids_init(void) } - -#ifdef _WIN32 -/* try to resolve an DCE/RPC interface name to it's name using the Windows registry entries */ -/* XXX - might be better to fill all interfaces into our database at startup instead of searching each time */ -int -ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len) -{ - TCHAR *reg_uuid_name; - HKEY hKey = NULL; - DWORD uuid_max_size = MAX_PATH; - TCHAR *reg_uuid_str; - - reg_uuid_name=ep_alloc(MAX_PATH*sizeof(TCHAR)); - reg_uuid_str=ep_alloc(MAX_PATH*sizeof(TCHAR)); - - if(uuid_name_max_len < 2){ - return 0; - } - reg_uuid_name[0] = '\0'; - _snwprintf(reg_uuid_str, MAX_PATH, _T("SOFTWARE\\Classes\\Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"), - if_id.data1, if_id.data2, if_id.data3, - if_id.data4[0], if_id.data4[1], - if_id.data4[2], if_id.data4[3], - if_id.data4[4], if_id.data4[5], - if_id.data4[6], if_id.data4[7]); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_uuid_str, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)reg_uuid_name, &uuid_max_size) == ERROR_SUCCESS && uuid_max_size <= MAX_PATH) { - g_snprintf(uuid_name, uuid_name_max_len, "%s", utf_16to8(reg_uuid_name)); - RegCloseKey(hKey); - return strlen(uuid_name); - } - RegCloseKey(hKey); - } - return 0; /* we didn't find anything anyhow. Please don't use the string! */ - -} -#endif - - - /* Tries to match a guid against its name. Returns the associated string ptr on a match. Formats uuid number and returns the resulting string, if name is unknown. |