pidgin: a577d7fa: Named initializers and most other C99ism...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sun Mar 13 12:50:47 EDT 2011


----------------------------------------------------------------------
Revision: a577d7fa521e3e8c8ea3657cf2bf7336db04c6d0
Parent:   c9d9df8328b3821943ad9922c10837433df34d46
Author:   florian at instantbird.org
Date:     03/13/11 12:47:36
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a577d7fa521e3e8c8ea3657cf2bf7336db04c6d0

Changelog: 

Named initializers and most other C99isms don't work in Visual C++ .NET 2005 in
C mode.  This is troublesome for Instantbird.  This remedies the problem for the
cipher code, which allows Instantbird's libpurple build to work again.

Changes against parent c9d9df8328b3821943ad9922c10837433df34d46

  patched  libpurple/ciphers/des.c
  patched  libpurple/ciphers/gchecksum.c
  patched  libpurple/ciphers/hmac.c
  patched  libpurple/ciphers/md4.c
  patched  libpurple/ciphers/md5.c
  patched  libpurple/ciphers/rc4.c
  patched  libpurple/ciphers/sha1.c
  patched  libpurple/ciphers/sha256.c

-------------- next part --------------
============================================================
--- libpurple/ciphers/md4.c	d8e758467a7e8fca53718ed08106092f67842b37
+++ libpurple/ciphers/md4.c	d64fadf6f6e61f9280c653a6b3b9ba84ce17c99b
@@ -270,12 +270,24 @@ static PurpleCipherOps MD4Ops = {
 }
 
 static PurpleCipherOps MD4Ops = {
-	.init = md4_init,
-	.reset = md4_reset,
-	.uninit = md4_uninit,
-	.append = md4_append,
-	.digest = md4_digest,
-	.get_block_size = md4_get_block_size,
+	NULL,                   /* Set option */
+	NULL,                   /* Get option */
+	md4_init,               /* init */
+	md4_reset,              /* reset */
+	md4_uninit,             /* uninit */
+	NULL,                   /* set iv */
+	md4_append,             /* append */
+	md4_digest,             /* digest */
+	NULL,                   /* encrypt */
+	NULL,                   /* decrypt */
+	NULL,                   /* set salt */
+	NULL,                   /* get salt size */
+	NULL,                   /* set key */
+	NULL,                   /* get key size */
+	NULL,                   /* set batch mode */
+	NULL,                   /* get batch mode */
+	md4_get_block_size,     /* get block size */
+	NULL                    /* set key with len */
 };
 
 PurpleCipherOps *
============================================================
--- libpurple/ciphers/md5.c	fc406dc092c9cc26261a07e446149cf2311eef36
+++ libpurple/ciphers/md5.c	f2ae7845007a0a6a57d702907f78438f575c312a
@@ -297,12 +297,24 @@ static PurpleCipherOps MD5Ops = {
 }
 
 static PurpleCipherOps MD5Ops = {
-	.init = md5_init,
-	.reset = md5_reset,
-	.uninit = md5_uninit,
-	.append = md5_append,
-	.digest = md5_digest,
-	.get_block_size = md5_get_block_size,
+	NULL,			/* Set Option		*/
+	NULL,			/* Get Option		*/
+	md5_init,		/* init				*/
+	md5_reset,		/* reset			*/
+	md5_uninit,	/* uninit			*/
+	NULL,			/* set iv			*/
+	md5_append,	/* append			*/
+	md5_digest,		/* digest			*/
+	NULL,			/* encrypt			*/
+	NULL,			/* decrypt			*/
+	NULL,			/* set salt			*/
+	NULL,			/* get salt size	*/
+	NULL,			/* set key			*/
+	NULL,			/* get key size		*/
+	NULL,			/* set batch mode */
+	NULL,			/* get batch mode */
+	md5_get_block_size,	/* get block size */
+	NULL			/* set key with len */
 };
 
 PurpleCipherOps *
============================================================
--- libpurple/ciphers/hmac.c	723d6c956f0574714cb9798f59dd6cec86542801
+++ libpurple/ciphers/hmac.c	6ed8c0a754318c3c927022a1e0c8cf5ad4d6ad1c
@@ -191,16 +191,24 @@ static PurpleCipherOps HMACOps = {
 }
 
 static PurpleCipherOps HMACOps = {
-	.set_option = hmac_set_opt,
-	.get_option = hmac_get_opt,
-	.init = hmac_init,
-	.reset = hmac_reset,
-	.uninit = hmac_uninit,
-	.append = hmac_append,
-	.digest = hmac_digest,
-	.set_key = hmac_set_key,
-	.get_block_size = hmac_get_block_size,
-	.set_key_with_len = hmac_set_key_with_len,
+	hmac_set_opt,           /* Set option */
+	hmac_get_opt,           /* Get option */
+	hmac_init,               /* init */
+	hmac_reset,              /* reset */
+	hmac_uninit,             /* uninit */
+	NULL,                   /* set iv */
+	hmac_append,             /* append */
+	hmac_digest,             /* digest */
+	NULL,                   /* encrypt */
+	NULL,                   /* decrypt */
+	NULL,                   /* set salt */
+	NULL,                   /* get salt size */
+	hmac_set_key,           /* set key */
+	NULL,                   /* get key size */
+	NULL,                   /* set batch mode */
+	NULL,                   /* get batch mode */
+	hmac_get_block_size,    /* get block size */
+	hmac_set_key_with_len   /* set key with len */
 };
 
 PurpleCipherOps *
============================================================
--- libpurple/ciphers/sha1.c	cea9ae53aa909fdf7397d2cefc52e3e9c411f7ac
+++ libpurple/ciphers/sha1.c	c737d9651bc9b62d09bdb3d4f59a5ba1c84d8907
@@ -252,14 +252,24 @@ static PurpleCipherOps SHA1Ops = {
 }
 
 static PurpleCipherOps SHA1Ops = {
-	.set_option = sha1_set_opt,
-	.get_option = sha1_get_opt,
-	.init = sha1_init,
-	.reset = sha1_reset,
-	.uninit = sha1_uninit,
-	.append = sha1_append,
-	.digest = sha1_digest,
-	.get_block_size = sha1_get_block_size,
+	sha1_set_opt,		/* Set Option		*/
+	sha1_get_opt,		/* Get Option		*/
+	sha1_init,		/* init				*/
+	sha1_reset,		/* reset			*/
+	sha1_uninit,		/* uninit			*/
+	NULL,			/* set iv			*/
+	sha1_append,		/* append			*/
+	sha1_digest,	/* digest			*/
+	NULL,			/* encrypt			*/
+	NULL,			/* decrypt			*/
+	NULL,			/* set salt			*/
+	NULL,			/* get salt size	*/
+	NULL,			/* set key			*/
+	NULL,			/* get key size		*/
+	NULL,			/* set batch mode */
+	NULL,			/* get batch mode */
+	sha1_get_block_size,	/* get block size */
+	NULL			/* set key with len */
 };
 
 PurpleCipherOps *
============================================================
--- libpurple/ciphers/rc4.c	f61c09bae417807482368e3951dc499bb1ddc3e2
+++ libpurple/ciphers/rc4.c	a861a860c1829fbe761d8445a0f6955a65a6cf97
@@ -165,14 +165,24 @@ static PurpleCipherOps RC4Ops = {
 }
 
 static PurpleCipherOps RC4Ops = {
-	.set_option = rc4_set_opt,
-	.get_option = rc4_get_opt,
-	.init = rc4_init,
-	.reset = rc4_reset,
-	.uninit = rc4_uninit,
-	.encrypt = rc4_encrypt,
-	.set_key = rc4_set_key,
-	.get_key_size = rc4_get_key_size,
+	rc4_set_opt,   /* Set Option    */
+	rc4_get_opt,   /* Get Option    */
+	rc4_init,      /* init          */
+	rc4_reset,     /* reset         */
+	rc4_uninit,    /* uninit        */
+	NULL,          /* set iv        */
+	NULL,          /* append        */
+	NULL,          /* digest        */
+	rc4_encrypt,   /* encrypt       */
+	NULL,          /* decrypt       */
+	NULL,          /* set salt      */
+	NULL,          /* get salt size */
+	rc4_set_key,   /* set key       */
+	rc4_get_key_size, /* get key size  */
+	NULL,          /* set batch mode */
+	NULL,          /* get batch mode */
+	NULL,          /* get block size */
+	NULL           /* set key with len */
 };
 
 PurpleCipherOps *
============================================================
--- libpurple/ciphers/sha256.c	37a64492bc7d731e15d339591eeff59fd7b9e89c
+++ libpurple/ciphers/sha256.c	f91024f3104a2d945fad16851012524a5bc358d2
@@ -254,14 +254,24 @@ static PurpleCipherOps SHA256Ops = {
 }
 
 static PurpleCipherOps SHA256Ops = {
-	.set_option = sha256_set_opt,
-	.get_option = sha256_get_opt,
-	.init = sha256_init,
-	.reset = sha256_reset,
-	.uninit = sha256_uninit,
-	.append = sha256_append,
-	.digest = sha256_digest,
-	.get_block_size = sha256_get_block_size,
+	sha256_set_opt,			/* Set Option		*/
+	sha256_get_opt,			/* Get Option		*/
+	sha256_init,	/* init				*/
+	sha256_reset,	/* reset			*/
+	sha256_uninit,	/* uninit			*/
+	NULL,			/* set iv			*/
+	sha256_append,	/* append			*/
+	sha256_digest,	/* digest			*/
+	NULL,			/* encrypt			*/
+	NULL,			/* decrypt			*/
+	NULL,			/* set salt			*/
+	NULL,			/* get salt size	*/
+	NULL,			/* set key			*/
+	NULL,			/* get key size		*/
+	NULL,			/* set batch mode */
+	NULL,			/* get batch mode */
+	sha256_get_block_size,	/* get block size */
+	NULL			/* set key with len */
 };
 
 PurpleCipherOps *
============================================================
--- libpurple/ciphers/des.c	c18ba22e56b2267266c2c8115ef40d0e09da2dff
+++ libpurple/ciphers/des.c	bb006758a37407b63262897390e9441cb5100990
@@ -460,11 +460,24 @@ static PurpleCipherOps DESOps = {
 }
 
 static PurpleCipherOps DESOps = {
-	.init = des_init,
-	.uninit = des_uninit,
-	.encrypt = des_encrypt,
-	.decrypt = des_decrypt,
-	.set_key = des_set_key,
+	NULL,              /* Set option */
+	NULL,              /* Get option */
+	des_init,          /* init */
+ 	NULL,              /* reset */
+	des_uninit,        /* uninit */
+	NULL,              /* set iv */
+	NULL,              /* append */
+	NULL,              /* digest */
+	des_encrypt,       /* encrypt */
+	des_decrypt,       /* decrypt */
+	NULL,              /* set salt */
+	NULL,              /* get salt size */
+	des_set_key,       /* set key */
+	NULL,              /* get key size */
+	NULL,              /* set batch mode */
+	NULL,              /* get batch mode */
+	NULL,              /* get block size */
+	NULL               /* set key with len */
 };
 
 /******************************************************************************
@@ -798,14 +811,24 @@ static PurpleCipherOps DES3Ops = {
 }
 
 static PurpleCipherOps DES3Ops = {
-	.init = des3_init,
-	.uninit = des3_uninit,
-	.set_iv = des3_set_iv,
-	.encrypt = des3_encrypt,
-	.decrypt = des3_decrypt,
-	.set_key = des3_set_key,
-	.set_batch_mode = des3_set_batch,
-	.get_batch_mode = des3_get_batch,
+	NULL,              /* Set option */
+	NULL,              /* Get option */
+	des3_init,         /* init */
+	NULL,              /* reset */
+	des3_uninit,       /* uninit */
+	des3_set_iv,       /* set iv */
+	NULL,              /* append */
+	NULL,              /* digest */
+	des3_encrypt,      /* encrypt */
+	des3_decrypt,      /* decrypt */
+	NULL,              /* set salt */
+	NULL,              /* get salt size */
+	des3_set_key,      /* set key */
+	NULL,              /* get key size */
+	des3_set_batch,    /* set batch mode */
+	des3_get_batch,    /* get batch mode */
+	NULL,              /* get block size */
+	NULL               /* set key with len */
 };
 
 /******************************************************************************
============================================================
--- libpurple/ciphers/gchecksum.c	c02995bb294a17626e079397e47e27a71f201e83
+++ libpurple/ciphers/gchecksum.c	c0b39c2fd6864e18d3bfd6448ca80363e90b2d54
@@ -108,12 +108,24 @@ purple_g_checksum_digest(PurpleCipherCon
 	} \
 	\
 	static PurpleCipherOps camel##Ops = { \
-		.init = lower##_init, \
-		.reset = lower##_reset, \
-		.uninit = purple_g_checksum_uninit, \
-		.append = purple_g_checksum_append, \
-		.digest = lower##_digest, \
-		.get_block_size = lower##_get_block_size, \
+		NULL,                     /* Set option */       \
+		NULL,                     /* Get option */       \
+		lower##_init,             /* init */             \
+		lower##_reset,            /* reset */            \
+		purple_g_checksum_uninit, /* uninit */           \
+		NULL,                     /* set iv */           \
+		purple_g_checksum_append, /* append */           \
+		lower##_digest,           /* digest */           \
+		NULL,                     /* encrypt */          \
+		NULL,                     /* decrypt */          \
+		NULL,                     /* set salt */         \
+		NULL,                     /* get salt size */    \
+		NULL,                     /* set key */          \
+		NULL,                     /* get key size */     \
+		NULL,                     /* set batch mode */   \
+		NULL,                     /* get batch mode */   \
+		lower##_get_block_size,   /* get block size */   \
+		NULL                      /* set key with len */ \
 	}; \
 	\
 	PurpleCipherOps * \


More information about the Commits mailing list