summaryrefslogtreecommitdiff
path: root/ui/gtk/airpcap_gui_utils.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
committerGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
commit8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch)
treead4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /ui/gtk/airpcap_gui_utils.c
parent8ede6b7dc09aa636f87147ab432a137c209e8aca (diff)
downloadwireshark-8ed7a73e22c049a2e013bb436e599bff41fc5b9b.tar.gz
Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
Diffstat (limited to 'ui/gtk/airpcap_gui_utils.c')
-rw-r--r--ui/gtk/airpcap_gui_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/gtk/airpcap_gui_utils.c b/ui/gtk/airpcap_gui_utils.c
index 8b10adf949..c33308cde5 100644
--- a/ui/gtk/airpcap_gui_utils.c
+++ b/ui/gtk/airpcap_gui_utils.c
@@ -269,7 +269,7 @@ airpcap_add_key_to_list(GtkListStore *key_list_store, gchar* type, gchar* key, g
void
airpcap_fill_key_list(GtkListStore *key_list_store)
{
- gchar* s = NULL;
+ const gchar* s = NULL;
unsigned int i,n;
airpcap_if_info_t* fake_if_info;
GList* wireshark_key_list=NULL;
@@ -411,7 +411,7 @@ airpcap_get_link_type(const gchar* name)
* Returns the string name corresponding to the given AirpcapLinkType, or
* NULL in case of error.
*/
-gchar*
+const gchar*
airpcap_get_link_name(AirpcapLinkType lt)
{
if(lt == AIRPCAP_LT_802_11){
@@ -715,7 +715,7 @@ airpcap_add_keys_to_driver_from_list(GtkListStore *key_list_store, airpcap_if_in
/*
* Calculate the size of the keys collection
*/
- KeysCollectionSize = sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey);
+ KeysCollectionSize = (guint) (sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey));
/*
* Allocate the collection
@@ -798,7 +798,7 @@ airpcap_read_and_save_decryption_keys_from_list_store(GtkListStore* key_list_sto
char* tmp_type = NULL;
char* tmp_key = NULL;
- char* tmp_ssid = "";
+ char* tmp_ssid = NULL;
decryption_key_t* tmp_dk=NULL;
@@ -831,7 +831,7 @@ airpcap_read_and_save_decryption_keys_from_list_store(GtkListStore* key_list_sto
tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
tmp_dk->key = g_string_new(tmp_key);
tmp_dk->ssid = g_byte_array_new();
- uri_str_to_bytes(tmp_ssid, tmp_dk->ssid);
+ uri_str_to_bytes(tmp_ssid?tmp_ssid:"", tmp_dk->ssid);
tmp_dk->type = AIRPDCAP_KEY_TYPE_WPA_PWD;
tmp_dk->bits = 256;
key_list = g_list_append(key_list,tmp_dk);