pidgin: 1e1cda8e: Let XS do the argument checking/erroring..
deryni at pidgin.im
deryni at pidgin.im
Tue Feb 17 22:35:40 EST 2009
-----------------------------------------------------------------
Revision: 1e1cda8e85e24ace829c9f7c9765fd70495646d6
Ancestor: f074d61f9170c0dbcf2edf5b46ac5f1f8574361b
Author: deryni at pidgin.im
Date: 2009-02-12T06:00:15
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1e1cda8e85e24ace829c9f7c9765fd70495646d6
Modified files:
libpurple/plugins/perl/common/Server.xs
ChangeLog:
Let XS do the argument checking/erroring for us for the components argument to
Purple::Serv::join_chat, we weren't doing any before.
Closes #8199.
-------------- next part --------------
============================================================
--- libpurple/plugins/perl/common/Server.xs 5eb2d711e3c3b2a8baa4491db3b7b2b87f3bed32
+++ libpurple/plugins/perl/common/Server.xs 76bfd20797a49127e64aef799082e07c85fd9178
@@ -122,29 +122,28 @@ serv_got_typing_stopped(gc, name)
Purple::Connection gc
const char *name
-void
-serv_join_chat(con, components)
- Purple::Connection con
- SV * components
-INIT:
- HV * t_HV;
- HE * t_HE;
- SV * t_SV;
- GHashTable * t_GHash;
+void
+serv_join_chat(conn, components)
+ Purple::Connection conn
+ HV * components
+PREINIT:
+ HE *t_HE;
+ SV *t_SV;
I32 len;
+ GHashTable *t_GHash;
char *t_key, *t_value;
CODE:
- t_HV = (HV *)SvRV(components);
t_GHash = g_hash_table_new(g_str_hash, g_str_equal);
- for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) {
+ for (t_HE = hv_iternext(components); t_HE != NULL;
+ t_HE = hv_iternext(components)) {
t_key = hv_iterkey(t_HE, &len);
- t_SV = *hv_fetch(t_HV, t_key, len, 0);
- t_value = SvPVutf8_nolen(t_SV);
+ t_SV = *hv_fetch(components, t_key, len, 0);
+ t_value = SvPVutf8_nolen(t_SV);
g_hash_table_insert(t_GHash, t_key, t_value);
}
- serv_join_chat(con, t_GHash);
+ serv_join_chat(conn, t_GHash);
void
serv_move_buddy(buddy, group1, group2)
More information about the Commits
mailing list