seahorse r2654 - in trunk: . pgp pkcs11



Author: sadam
Date: Sat Dec 13 00:45:22 2008
New Revision: 2654
URL: http://svn.gnome.org/viewvc/seahorse?rev=2654&view=rev

Log:
2008-12-12  Adam Schreiber  <sadam clemson edu>
    
    * pkcs11/seahorse-pkcs11-source.c
    * pkcs11/seahorse-pkcs11.c:
    * pgp/seahorse-pgp-commands.vala:
    * pgp/seahorse-pgp-commands.c: Fix compiler warnings


Modified:
   trunk/ChangeLog
   trunk/pgp/seahorse-pgp-commands.c
   trunk/pgp/seahorse-pgp-commands.vala
   trunk/pkcs11/seahorse-pkcs11-source.c
   trunk/pkcs11/seahorse-pkcs11.c

Modified: trunk/pgp/seahorse-pgp-commands.c
==============================================================================
--- trunk/pgp/seahorse-pgp-commands.c	(original)
+++ trunk/pgp/seahorse-pgp-commands.c	Sat Dec 13 00:45:22 2008
@@ -87,8 +87,8 @@
 	char* message;
 	GList* to_delete;
 	guint length;
-	guint _tmp10;
-	SeahorseOperation* _tmp12;
+	guint _tmp9;
+	SeahorseOperation* _tmp11;
 	self = SEAHORSE_PGP_COMMANDS (base);
 	g_return_val_if_fail (objects != NULL, NULL);
 	num = g_list_length (objects);
@@ -109,64 +109,60 @@
 		GList* obj_it;
 		obj_collection = objects;
 		for (obj_it = obj_collection; obj_it != NULL; obj_it = obj_it->next) {
-			SeahorseObject* _tmp4;
+			SeahorseObject* _tmp3;
 			SeahorseObject* obj;
-			_tmp4 = NULL;
-			obj = (_tmp4 = ((SeahorseObject*) (obj_it->data)), (_tmp4 == NULL ? NULL : g_object_ref (_tmp4)));
+			_tmp3 = NULL;
+			obj = (_tmp3 = ((SeahorseObject*) (obj_it->data)), (_tmp3 == NULL ? NULL : g_object_ref (_tmp3)));
 			{
-				GType _tmp3;
-				_tmp3 = G_TYPE_FROM_INSTANCE (G_OBJECT (obj));
-				if (_tmp3 == SEAHORSE_PGP_TYPE_UID)
-				do {
+				if (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_UID) {
 					if (g_list_find (objects, seahorse_object_get_parent (obj)) == NULL) {
 						SeahorseObject* _tmp1;
 						_tmp1 = NULL;
 						to_delete = g_list_prepend (to_delete, (_tmp1 = obj, (_tmp1 == NULL ? NULL : g_object_ref (_tmp1))));
 						num_identities = num_identities + 1;
 					}
-					break;
-				} while (0); else if (_tmp3 == SEAHORSE_PGP_TYPE_KEY)
-				do {
-					SeahorseObject* _tmp2;
-					_tmp2 = NULL;
-					to_delete = g_list_prepend (to_delete, (_tmp2 = obj, (_tmp2 == NULL ? NULL : g_object_ref (_tmp2))));
-					num_keys = num_keys + 1;
-					break;
-				} while (0);
+				} else {
+					if (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_KEY) {
+						SeahorseObject* _tmp2;
+						_tmp2 = NULL;
+						to_delete = g_list_prepend (to_delete, (_tmp2 = obj, (_tmp2 == NULL ? NULL : g_object_ref (_tmp2))));
+						num_keys = num_keys + 1;
+					}
+				}
 				(obj == NULL ? NULL : (obj = (g_object_unref (obj), NULL)));
 			}
 		}
 	}
 	/* Figure out a good prompt message */
 	length = g_list_length (to_delete);
-	_tmp10 = length;
-	if (_tmp10 == 0)
+	_tmp9 = length;
+	if (_tmp9 == 0)
 	do {
-		SeahorseOperation* _tmp5;
-		_tmp5 = NULL;
-		return (_tmp5 = NULL, (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp5);
-	} while (0); else if (_tmp10 == 1)
+		SeahorseOperation* _tmp4;
+		_tmp4 = NULL;
+		return (_tmp4 = NULL, (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp4);
+	} while (0); else if (_tmp9 == 1)
 	do {
-		char* _tmp6;
-		_tmp6 = NULL;
-		message = (_tmp6 = g_strdup_printf (_ ("Are you sure you want to permanently delete %s?"), seahorse_object_get_label (((SeahorseObject*) (((SeahorseObject*) (to_delete->data)))))), (message = (g_free (message), NULL)), _tmp6);
+		char* _tmp5;
+		_tmp5 = NULL;
+		message = (_tmp5 = g_strdup_printf (_ ("Are you sure you want to permanently delete %s?"), seahorse_object_get_label (((SeahorseObject*) (((SeahorseObject*) (to_delete->data)))))), (message = (g_free (message), NULL)), _tmp5);
 		break;
 	} while (0); else
 	do {
 		if (num_keys > 0 && num_identities > 0) {
-			char* _tmp7;
-			_tmp7 = NULL;
-			message = (_tmp7 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d keys and identities?"), length), (message = (g_free (message), NULL)), _tmp7);
+			char* _tmp6;
+			_tmp6 = NULL;
+			message = (_tmp6 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d keys and identities?"), length), (message = (g_free (message), NULL)), _tmp6);
 		} else {
 			if (num_keys > 0) {
-				char* _tmp8;
-				_tmp8 = NULL;
-				message = (_tmp8 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d keys?"), length), (message = (g_free (message), NULL)), _tmp8);
+				char* _tmp7;
+				_tmp7 = NULL;
+				message = (_tmp7 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d keys?"), length), (message = (g_free (message), NULL)), _tmp7);
 			} else {
 				if (num_identities > 0) {
-					char* _tmp9;
-					_tmp9 = NULL;
-					message = (_tmp9 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d identities?"), length), (message = (g_free (message), NULL)), _tmp9);
+					char* _tmp8;
+					_tmp8 = NULL;
+					message = (_tmp8 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d identities?"), length), (message = (g_free (message), NULL)), _tmp8);
 				} else {
 					g_assert_not_reached ();
 				}
@@ -175,12 +171,12 @@
 		break;
 	} while (0);
 	if (!seahorse_util_prompt_delete (message, GTK_WIDGET (seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)))))) {
-		SeahorseOperation* _tmp11;
-		_tmp11 = NULL;
-		return (_tmp11 = NULL, (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp11);
+		SeahorseOperation* _tmp10;
+		_tmp10 = NULL;
+		return (_tmp10 = NULL, (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp10);
 	}
-	_tmp12 = NULL;
-	return (_tmp12 = seahorse_source_delete_objects (to_delete), (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp12);
+	_tmp11 = NULL;
+	return (_tmp11 = seahorse_source_delete_objects (to_delete), (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp11);
 }
 
 

Modified: trunk/pgp/seahorse-pgp-commands.vala
==============================================================================
--- trunk/pgp/seahorse-pgp-commands.vala	(original)
+++ trunk/pgp/seahorse-pgp-commands.vala	Sat Dec 13 00:45:22 2008
@@ -86,18 +86,14 @@
 			 */ 
 			GLib.List<Object> to_delete = new GLib.List<Object>();
 			foreach (var obj in objects) {
-				switch (obj.get_type()) {
-				case typeof (Pgp.Uid):
+				if (obj.get_type() == typeof (Pgp.Uid)) {
 					if (objects.find(obj.parent) == null) {
 						to_delete.prepend(obj);
 						++num_identities;
 					}
-					break;
-					
-				case typeof (Pgp.Key):
+				} else if (obj.get_type() == typeof (Pgp.Key)) {
 					to_delete.prepend(obj);
 					++num_keys;
-					break;
 				}
 			}
 

Modified: trunk/pkcs11/seahorse-pkcs11-source.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-source.c	(original)
+++ trunk/pkcs11/seahorse-pkcs11-source.c	Sat Dec 13 00:45:22 2008
@@ -375,7 +375,7 @@
 	SeahorsePkcs11Certificate* _tmp3;
 	g_return_if_fail (SEAHORSE_PKCS11_IS_SOURCE (self));
 	g_return_if_fail (GP11_IS_OBJECT (object));
-	g_return_if_fail (GP11_IS_ATTRIBUTES (attrs));
+	g_return_if_fail (attrs != NULL);
 	/* Build up an identifier for this object */
 	id = seahorse_pkcs11_id_from_attributes (attrs);
 	g_return_if_fail (id != 0);
@@ -935,7 +935,7 @@
 	GParameter * __params_it;
 	SeahorsePkcs11SourceLoader * self;
 	g_return_val_if_fail (SEAHORSE_PKCS11_IS_SOURCE (source), NULL);
-	g_return_val_if_fail (GP11_IS_ATTRIBUTES (unique_attrs), NULL);
+	g_return_val_if_fail (unique_attrs != NULL, NULL);
 	__params = g_new0 (GParameter, 2);
 	__params_it = __params;
 	__params_it->name = "source";
@@ -943,7 +943,7 @@
 	g_value_set_object (&__params_it->value, source);
 	__params_it++;
 	__params_it->name = "unique-attrs";
-	g_value_init (&__params_it->value, GP11_TYPE_ATTRIBUTES);
+	g_value_init (&__params_it->value, G_TYPE_POINTER);
 	g_value_set_pointer (&__params_it->value, unique_attrs);
 	__params_it++;
 	self = g_object_newv (SEAHORSE_PKCS11_SOURCE_TYPE_LOADER, __params_it - __params, __params);
@@ -1091,7 +1091,7 @@
 	GParameter * __params_it;
 	SeahorsePkcs11SourceImporter * self;
 	g_return_val_if_fail (SEAHORSE_PKCS11_IS_SOURCE (source), NULL);
-	g_return_val_if_fail (GP11_IS_ATTRIBUTES (import), NULL);
+	g_return_val_if_fail (import != NULL, NULL);
 	__params = g_new0 (GParameter, 1);
 	__params_it = __params;
 	__params_it->name = "source";

Modified: trunk/pkcs11/seahorse-pkcs11.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11.c	(original)
+++ trunk/pkcs11/seahorse-pkcs11.c	Sat Dec 13 00:45:22 2008
@@ -43,7 +43,7 @@
 	char* _tmp4;
 	char* value;
 	GQuark _tmp5;
-	g_return_val_if_fail (GP11_IS_ATTRIBUTES (attrs), 0U);
+	g_return_val_if_fail (attrs != NULL, 0U);
 	/* These cases should have been covered by the programmer */
 	klass = 0UL;
 	if (!gp11_attributes_find_ulong (attrs, CKA_CLASS, &klass)) {
@@ -74,7 +74,7 @@
 	gint ckid_length1;
 	guchar* ckid;
 	gboolean _tmp6;
-	g_return_val_if_fail (GP11_IS_ATTRIBUTES (attrs), FALSE);
+	g_return_val_if_fail (attrs != NULL, FALSE);
 	if (id == 0) {
 		return FALSE;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]