pidgin: 122e7022: Various perl warning fixes as well as re...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Fri May 22 01:35:44 EDT 2009
-----------------------------------------------------------------
Revision: 122e7022b562ad4e1efe3289c682fe972dd9ae91
Ancestor: d8736814cb67ade87f1a48b8ff85c8690327fa71
Author: darkrain42 at pidgin.im
Date: 2009-05-22T04:56:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/122e7022b562ad4e1efe3289c682fe972dd9ae91
Modified files:
libpurple/plugins/perl/common/Certificate.xs
libpurple/plugins/perl/common/Cipher.xs
libpurple/plugins/perl/common/Util.xs
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/plugins/perl/common/Certificate.xs 7cb1c4a959341b1736216a66214233ac59d3a75f
+++ libpurple/plugins/perl/common/Certificate.xs 2f09254414a7b6add63b5d356827678cb68b1a25
@@ -214,7 +214,7 @@ purple_certificate_get_fingerprint_sha1(
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
============================================================
--- libpurple/plugins/perl/common/Cipher.xs 1826b41daee220db29be79ed137ee1355936916a
+++ libpurple/plugins/perl/common/Cipher.xs 9e2870995a990e91d1019d8cc1eef580b0d85371
@@ -66,9 +66,9 @@ purple_cipher_digest_region(name, data_s
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 @@ purple_cipher_context_digest(context, in
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 @@ purple_cipher_context_encrypt(context, d
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 @@ purple_cipher_context_decrypt(context, d
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);
============================================================
--- libpurple/plugins/perl/common/Util.xs 37fb61f65cac9ff956cf54e0dfa9bebcc4141699
+++ libpurple/plugins/perl/common/Util.xs 5fba429dad716bc84040920e2431cb52ad0002b9
@@ -69,7 +69,7 @@ purple_message_meify(SV *msg)
PREINIT:
char *message = NULL;
gboolean ret;
- gssize len;
+ gsize len;
CODE:
message = SvPV(msg, len);
message = g_strndup(message, len);
@@ -239,7 +239,7 @@ purple_base16_decode(str)
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 @@ purple_base64_decode(str)
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 @@ purple_quotedp_decode(str)
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 @@ const char*
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
More information about the Commits
mailing list