gobjectification: 3de42be1: Renamed purple_des_cipher_get_gtype to p...

grim at pidgin.im grim at pidgin.im
Sun Dec 4 17:15:53 EST 2011


----------------------------------------------------------------------
Revision: 3de42be1bd413f313d50c1bbf281a568698cbe68
Parent:   090dbeb08bc1bb7d9abc860e90fb318834a0d94e
Author:   grim at pidgin.im
Date:     03/24/11 19:41:15
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/3de42be1bd413f313d50c1bbf281a568698cbe68

Changelog: 

Renamed purple_des_cipher_get_gtype to purple_des_cipher_get_type
Cleaned up the GTypeInfo struct
Used spaces instead of tabs when aligning the GObject macros
Used name initializers for the GTypeInfo
Documented purple_des_cipher_new

Changes against parent 090dbeb08bc1bb7d9abc860e90fb318834a0d94e

  patched  libpurple/cipher/descipher.c
  patched  libpurple/cipher/descipher.h

-------------- next part --------------
============================================================
--- libpurple/cipher/descipher.c	a5897c0dbcbd4b6dbda55c2a806ad9abf003e191
+++ libpurple/cipher/descipher.c	6c4d52f2fcf48c73d5e1e7137850cb3cf9b4295e
@@ -23,12 +23,10 @@
 #define PURPLE_DES_CIPHER_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_DES_CIPHER, PurpleDESCipherPrivate))
 
-typedef struct _PurpleDESCipherPrivate			PurpleDESCipherPrivate;
-struct _PurpleDESCipherPrivate
-{
+typedef struct {
 	guint32 encrypt_subkeys[32];
 	guint32 decrypt_subkeys[32];
-};
+} PurpleDESCipherPrivate;
 
 /******************************************************************************
  * Enums
@@ -517,22 +515,15 @@ GType
  * API
  *****************************************************************************/
 GType
-purple_des_cipher_get_gtype(void)
-{
+purple_des_cipher_get_type(void) {
 	static GType type = 0;
 
 	if(type == 0) {
 		static const GTypeInfo info = {
-			sizeof(PurpleDESCipherClass),
-			NULL,
-			NULL,
-			(GClassInitFunc)purple_des_cipher_class_init,
-			NULL,
-			NULL,
-			sizeof(PurpleDESCipher),
-			0,
-			(GInstanceInitFunc)purple_des_cipher_init,
-			NULL
+			.class_size = sizeof(PurpleDESCipherClass),
+			.class_init = (GClassInitFunc)purple_des_cipher_class_init,
+			.instance_size = sizeof(PurpleDESCipher),
+			.instance_init = (GInstanceInitFunc)purple_des_cipher_init,
 		};
 
 		type = g_type_register_static(PURPLE_TYPE_CIPHER,
@@ -543,9 +534,15 @@ purple_des_cipher_get_gtype(void)
 	return type;
 }
 
+/**
+ * purple_des_cipher_new:
+ *
+ * Creates a new #PurpleCipher instance which implements the DES block cipher.
+ *
+ * Return Value: The new DES implementation of #PurpleCipher.
+ */
 PurpleCipher *
-purple_des_cipher_new(void)
-{
+purple_des_cipher_new(void) {
 	return g_object_new(PURPLE_TYPE_DES_CIPHER, NULL);
 }
 
============================================================
--- libpurple/cipher/descipher.h	d94f70b16d339c155df2bc169ca33d0bfa9ed5e8
+++ libpurple/cipher/descipher.h	8c55a0cb460aea60dd2cf51b144c1c3c54600746
@@ -27,17 +27,18 @@
 
 #include <cipher/cipher.h>
 
-#define PURPLE_TYPE_DES_CIPHER				(purple_des_cipher_get_gtype())
-#define PURPLE_DES_CIPHER(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_DES_CIPHER, PurpleDESCipher))
-#define PURPLE_DES_CIPHER_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_DES_CIPHER, PurpleDESCipherClass))
-#define PURPLE_IS_DES_CIPHER(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_DES_CIPHER))
-#define PURPLE_IS_DES_CIPHER_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((obj), PURPLE_TYPE_DES_CIPHER))
-#define PURPLE_DES_CIPHER_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_DES_CIPHER, PurpleDESCipherClass))
+#define PURPLE_TYPE_DES_CIPHER            (purple_des_cipher_get_type())
+#define PURPLE_DES_CIPHER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_DES_CIPHER, PurpleDESCipher))
+#define PURPLE_DES_CIPHER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_DES_CIPHER, PurpleDESCipherClass))
+#define PURPLE_IS_DES_CIPHER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_DES_CIPHER))
+#define PURPLE_IS_DES_CIPHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), PURPLE_TYPE_DES_CIPHER))
+#define PURPLE_DES_CIPHER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_DES_CIPHER, PurpleDESCipherClass))
 
-typedef struct _PurpleDESCipher				PurpleDESCipher;
-typedef struct _PurpleDESCipherClass		PurpleDESCipherClass;
+typedef struct _PurpleDESCipher           PurpleDESCipher;
+typedef struct _PurpleDESCipherClass      PurpleDESCipherClass;
 
 struct _PurpleDESCipher {
+	/*< private >*/
 	PurpleCipher gparent;
 
 	void (*_purple_reserved1)(void);
@@ -47,6 +48,7 @@ struct _PurpleDESCipherClass {
 };
 
 struct _PurpleDESCipherClass {
+	/*< private >*/
 	PurpleCipherClass gparent;
 
 	void (*_purple_reserved1)(void);
@@ -57,7 +59,7 @@ G_BEGIN_DECLS
 
 G_BEGIN_DECLS
 
-GType purple_des_cipher_get_gtype(void);
+GType purple_des_cipher_get_type(void);
 
 PurpleCipher *purple_des_cipher_new(void);
 


More information about the Commits mailing list