diff libpurple/plugins/perl/common/Cipher.xs @ 26935:31f65046b92d

Various perl warning fixes as well as real fixes to gconstpointer functions SvPV, et al. take a char*, whereas the cipher and base16/64 encoding functions return unsigned char*s, so cast away warnings about those distinctions. get_image_extension and get_image_filename take a (char *, len) as arguments, but the generated glue code wasn't interepreting the data as a giant array. I think purple_imgstore_get_data is also broken, but is not fixed.
author Paul Aurich <paul@darkrain42.org>
date Fri, 22 May 2009 04:56:05 +0000
parents 907f5f41e32a
children
line wrap: on
line diff
--- a/libpurple/plugins/perl/common/Cipher.xs	Fri May 22 04:44:07 2009 +0000
+++ b/libpurple/plugins/perl/common/Cipher.xs	Fri May 22 04:56:05 2009 +0000
@@ -66,9 +66,9 @@
 		guchar *data = NULL;
 		size_t data_len;
 	CODE:
-		data = SvPV(data_sv, data_len);
+		data = (guchar *)SvPV(data_sv, data_len);
 		SvUPGRADE(digest, SVt_PV);
-		buff = SvGROW(digest, in_len);
+		buff = (guchar *)SvGROW(digest, in_len);
 		ret = purple_cipher_digest_region(name, data, data_len, in_len, buff, &RETVAL);
 		if(!ret) {
 			SvSetSV_nosteal(digest, &PL_sv_undef);
@@ -181,7 +181,7 @@
 		guchar *buff = NULL;
 	CODE:
 		SvUPGRADE(digest, SVt_PV);
-		buff = SvGROW(digest, in_len);
+		buff = (guchar *)SvGROW(digest, in_len);
 		ret = purple_cipher_context_digest(context, in_len, buff, &RETVAL);
 		if(!ret) {
 			SvSetSV_nosteal(digest, &PL_sv_undef);
@@ -225,9 +225,9 @@
 		guchar *buff = NULL;
 		guchar *data = NULL;
 	CODE:
-		data = SvPV(data_sv, datalen);
+		data = (guchar *)SvPV(data_sv, datalen);
 		SvUPGRADE(output, SVt_PV);
-		buff = SvGROW(output, datalen);
+		buff = (guchar *)SvGROW(output, datalen);
 		RETVAL = purple_cipher_context_encrypt(context, data, datalen, buff, &outlen);
 		if(outlen != 0) {
 			SvPOK_only(output);
@@ -249,9 +249,9 @@
 		guchar *buff = NULL;
 		guchar *data = NULL;
 	CODE:
-		data = SvPV(data_sv, datalen);
+		data = (guchar *)SvPV(data_sv, datalen);
 		SvUPGRADE(output, SVt_PV);
-		buff = SvGROW(output, datalen);
+		buff = (guchar *)SvGROW(output, datalen);
 		RETVAL = purple_cipher_context_decrypt(context, data, datalen, buff, &outlen);
 		if(outlen != 0) {
 			SvPOK_only(output);