changeset 27017: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 c162a088489f
children e0f6c61ba779
files libpurple/plugins/perl/common/Certificate.xs libpurple/plugins/perl/common/Cipher.xs libpurple/plugins/perl/common/Util.xs
diffstat 3 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/common/Certificate.xs	Fri May 22 04:44:07 2009 +0000
+++ b/libpurple/plugins/perl/common/Certificate.xs	Fri May 22 04:56:05 2009 +0000
@@ -214,7 +214,7 @@
 		GByteArray *gba = NULL;
 	CODE:
 		gba = purple_certificate_get_fingerprint_sha1(crt);
-		RETVAL = newSVpv(gba->data, gba->len);
+		RETVAL = newSVpv((gchar *)gba->data, gba->len);
 		g_byte_array_free(gba, TRUE);
 	OUTPUT:
 		RETVAL
--- 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);
--- a/libpurple/plugins/perl/common/Util.xs	Fri May 22 04:44:07 2009 +0000
+++ b/libpurple/plugins/perl/common/Util.xs	Fri May 22 04:56:05 2009 +0000
@@ -69,7 +69,7 @@
 	PREINIT:
 		char *message = NULL;
 		gboolean ret;
-		gssize len;
+		gsize len;
 	CODE:
 		message = SvPV(msg, len);
 		message = g_strndup(message, len);
@@ -239,7 +239,7 @@
 	CODE:
 		ret = purple_base16_decode(str, &len);
 		if(len) {
-			RETVAL = newSVpv(ret, len);
+			RETVAL = newSVpv((gchar *)ret, len);
 		} else {
 			g_free(ret);
 			XSRETURN_UNDEF;
@@ -257,7 +257,7 @@
 	CODE:
 		ret = purple_base64_decode(str, &len);
 		if(len) {
-			RETVAL = newSVpv(ret, len);
+			RETVAL = newSVpv((gchar *)ret, len);
 		} else {
 			g_free(ret);
 			XSRETURN_UNDEF;
@@ -275,7 +275,7 @@
 	CODE:
 		ret = purple_quotedp_decode(str, &len);
 		if(len) {
-			RETVAL = newSVpv(ret, len);
+			RETVAL = newSVpv((gchar *)ret, len);
 		} else {
 			g_free(ret);
 			XSRETURN_UNDEF;
@@ -499,11 +499,11 @@
 	gpointer unused
 
 const char*
-purple_util_get_image_extension(gconstpointer data, size_t length(data))
+purple_util_get_image_extension(const char *data, size_t length(data))
 	PROTOTYPE: $
 
 gchar_own*
-purple_util_get_image_filename(gconstpointer image_data, size_t length(image_data))
+purple_util_get_image_filename(const char *image_data, size_t length(image_data))
 	PROTOTYPE: $
 
 Purple::XMLNode