gobjectification: 085ed868: Make Perl stuff mostly compile. Still ha...
qulogic at pidgin.im
qulogic at pidgin.im
Tue Aug 12 00:56:18 EDT 2008
-----------------------------------------------------------------
Revision: 085ed868ba1373e0c2260975abc8fb3da6a082db
Ancestor: a76a4b4375d96fef110a68e06d51afc24337fd33
Author: qulogic at pidgin.im
Date: 2008-08-11T06:07:16
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/085ed868ba1373e0c2260975abc8fb3da6a082db
Modified files:
libpurple/plugins/perl/common/Certificate.xs
libpurple/plugins/perl/common/Cipher.xs
libpurple/plugins/perl/common/Util.xs
ChangeLog:
Make Perl stuff mostly compile. Still has problems with GValue, see
#6200 comment 8.
-------------- next part --------------
============================================================
--- libpurple/plugins/perl/common/Certificate.xs 6c0a72f190cb8b169ce41e6de313a9fe53e9782a
+++ libpurple/plugins/perl/common/Certificate.xs e05c692e785a57dedb2b106ed382c090a02c9d37
@@ -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((char *)gba->data, gba->len);
g_byte_array_free(gba, TRUE);
OUTPUT:
RETVAL
============================================================
--- libpurple/plugins/perl/common/Cipher.xs 3f1fdcf1e25e7f783680744d1b8f7cf4ce8cd852
+++ libpurple/plugins/perl/common/Cipher.xs 848afb793099cef31f30c945af891b708126984d
@@ -6,7 +6,6 @@ BOOT:
BOOT:
{
HV *stash = gv_stashpv("Purple::Cipher::BatchMode", 1);
- HV *cipher_caps = gv_stashpv("Purple::Cipher::Caps", 1);
static const constiv *civ, const_iv[] = {
#define const_iv(name) {#name, (IV)PURPLE_CIPHER_BATCH_MODE_##name}
@@ -15,62 +14,10 @@ BOOT:
#undef const_iv
};
- static const constiv bm_const_iv[] = {
-#define const_iv(name) {#name, (IV)PURPLE_CIPHER_CAPS_##name}
- const_iv(SET_OPT),
- const_iv(GET_OPT),
- const_iv(INIT),
- const_iv(RESET),
- const_iv(UNINIT),
- const_iv(SET_IV),
- const_iv(APPEND),
- const_iv(DIGEST),
- const_iv(ENCRYPT),
- const_iv(DECRYPT),
- const_iv(SET_SALT),
- const_iv(GET_SALT_SIZE),
- const_iv(SET_KEY),
- const_iv(GET_KEY_SIZE),
- const_iv(SET_BATCH_MODE),
- const_iv(GET_BATCH_MODE),
- const_iv(GET_BLOCK_SIZE),
- const_iv(SET_KEY_WITH_LEN),
- const_iv(UNKNOWN),
-#undef const_iv
- };
-
for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; )
newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
-
- for (civ = bm_const_iv + sizeof(bm_const_iv) / sizeof(bm_const_iv[0]); civ-- > bm_const_iv; )
- newCONSTSUB(cipher_caps, (char *)civ->name, newSViv(civ->iv));
}
-size_t
-purple_cipher_digest_region(name, data_sv, in_len, digest)
- const gchar *name
- SV *data_sv
- size_t in_len
- SV *digest
- PREINIT:
- gboolean ret;
- guchar *buff = NULL;
- guchar *data = NULL;
- size_t data_len;
- CODE:
- data = SvPV(data_sv, data_len);
- SvUPGRADE(digest, SVt_PV);
- buff = 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);
- XSRETURN_UNDEF;
- }
- SvCUR_set(digest, RETVAL);
- SvPOK_only(digest);
- OUTPUT:
- RETVAL
-
MODULE = Purple::Cipher PACKAGE = Purple::Cipher PREFIX = purple_cipher_
PROTOTYPES: ENABLE
@@ -95,8 +42,8 @@ purple_cipher_digest(cipher, in_len, dig
gboolean ret;
guchar *buff = NULL;
CODE:
- SvUPGRADE(digest, SVt_PV);
- buff = SvGROW(digest, in_len);
+ (void)SvUPGRADE(digest, SVt_PV);
+ buff = (guchar *)SvGROW(digest, in_len);
ret = purple_cipher_digest(cipher, in_len, buff, &RETVAL);
if(!ret) {
SvSetSV_nosteal(digest, &PL_sv_undef);
@@ -117,7 +64,7 @@ purple_cipher_digest_to_str(cipher, in_l
gchar *buff = NULL;
CODE:
in_len += 1; /* perl shouldn't need to care about '\0' at the end */
- SvUPGRADE(digest_s, SVt_PV);
+ (void)SvUPGRADE(digest_s, SVt_PV);
buff = SvGROW(digest_s, in_len);
ret = purple_cipher_digest_to_str(cipher, in_len, buff, &RETVAL);
if(!ret) {
@@ -140,9 +87,9 @@ purple_cipher_encrypt(cipher, data_sv, o
guchar *buff = NULL;
guchar *data = NULL;
CODE:
- data = SvPV(data_sv, datalen);
- SvUPGRADE(output, SVt_PV);
- buff = SvGROW(output, datalen);
+ data = (guchar *)SvPV(data_sv, datalen);
+ (void)SvUPGRADE(output, SVt_PV);
+ buff = (guchar *)SvGROW(output, datalen);
RETVAL = purple_cipher_encrypt(cipher, data, datalen, buff, &outlen);
if(outlen != 0) {
SvPOK_only(output);
@@ -164,9 +111,9 @@ purple_cipher_decrypt(cipher, data_sv, o
guchar *buff = NULL;
guchar *data = NULL;
CODE:
- data = SvPV(data_sv, datalen);
- SvUPGRADE(output, SVt_PV);
- buff = SvGROW(output, datalen);
+ data = (guchar *)SvPV(data_sv, datalen);
+ (void)SvUPGRADE(output, SVt_PV);
+ buff = (guchar *)SvGROW(output, datalen);
RETVAL = purple_cipher_decrypt(cipher, data, datalen, buff, &outlen);
if(outlen != 0) {
SvPOK_only(output);
============================================================
--- libpurple/plugins/perl/common/Util.xs 76a9c4398f4be0f9a372491fcbb0bf6cd312b5e6
+++ libpurple/plugins/perl/common/Util.xs e63cf7746a4913b021b3682fca604530335ba4f4
@@ -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);
@@ -256,7 +256,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;
@@ -274,7 +274,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;
@@ -292,7 +292,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;
@@ -546,7 +546,7 @@ PROTOTYPES: ENABLE
MODULE = Purple::Util PACKAGE = Purple::Util::Http PREFIX = purple_http_
PROTOTYPES: ENABLE
-gchar *
+gchar_own *
purple_http_digest_calculate_session_key(algorithm, username, realm, password, nonce, client_nonce)
const gchar *algorithm
const gchar *username
@@ -555,7 +555,7 @@ purple_http_digest_calculate_session_key
const gchar *nonce
const gchar *client_nonce
-gchar *
+gchar_own *
purple_http_digest_calculate_response(algorithm, method, digest_uri, qop, entity, nonce, nonce_count, client_nonce, session_key)
const gchar *algorithm
const gchar *method
More information about the Commits
mailing list