diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-10 21:12:39 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-10 21:12:39 +0000 |
commit | ebdaa110f1e7dd48483d0f0ebc606c13b2e44ba3 (patch) | |
tree | cb0f4278017ec6fb6be5ad255f12611dd2da0c8a /src | |
parent | 6c97f13cadcdb9714c331a671aee86ce260aeb34 (diff) | |
download | irssi-ebdaa110f1e7dd48483d0f0ebc606c13b2e44ba3.zip |
bugfixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1101 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/perl/common/Core.xs | 6 | ||||
-rwxr-xr-x | src/perl/get-signals.pl | 4 | ||||
-rw-r--r-- | src/perl/perl-common.c | 2 | ||||
-rw-r--r-- | src/perl/perl-signals.c | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs index dab69e94..b473bf69 100644 --- a/src/perl/common/Core.xs +++ b/src/perl/common/Core.xs @@ -6,11 +6,11 @@ signal_emit(signal, ...) PREINIT: STRLEN n_a; CODE: - void *p[7]; + void *p[SIGNAL_MAX_ARGUMENTS]; int n; memset(p, 0, sizeof(p)); - for (n = 1; n < items && n < 7; n++) { + for (n = 1; n < items && n < SIGNAL_MAX_ARGUMENTS+1; n++) { if (SvPOKp(ST(n))) p[n-1] = SvPV(ST(n), n_a); else if (irssi_is_ref_object(ST(n))) @@ -18,7 +18,7 @@ CODE: else p[n-1] = (void *) SvIV((SV*)SvRV(ST(n))); } - signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5], p[6]); + signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5]); void signal_add(signal, func) diff --git a/src/perl/get-signals.pl b/src/perl/get-signals.pl index 17a60902..29ec7e5e 100755 --- a/src/perl/get-signals.pl +++ b/src/perl/get-signals.pl @@ -47,7 +47,7 @@ while (<STDIN>) { s/WI_ITEM_REC[^,]*/iobject/g; s/([\w:]+)(,|$)/"\1"\2/g; - print " { -1, \"$signal\", { $_, NULL } },\n"; + print " { \"$signal\", { $_, NULL } },\n"; } -print "\n { -1, NULL }\n};\n"; +print "\n { NULL }\n};\n"; diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c index 145b72c3..e21e0cb8 100644 --- a/src/perl/perl-common.c +++ b/src/perl/perl-common.c @@ -109,7 +109,7 @@ void *irssi_ref_object(SV *o) hv = hvref(o); if (hv == NULL) - return 0; + return NULL; sv = hv_fetch(hv, "_irssi", 6, 0); if (sv == NULL) diff --git a/src/perl/perl-signals.c b/src/perl/perl-signals.c index 73a4da40..16e07444 100644 --- a/src/perl/perl-signals.c +++ b/src/perl/perl-signals.c @@ -16,7 +16,6 @@ typedef struct { } PERL_SIGNAL_REC; typedef struct { - int signal_id; char *signal; char *args[7]; } PERL_SIGNAL_ARGS_REC; @@ -53,7 +52,7 @@ static void perl_call_signal(const char *func, int signal_id, gconstpointer *args) { dSP; - int retcount, ret; + int retcount; PERL_SIGNAL_ARGS_REC *rec; HV *stash; @@ -347,8 +346,9 @@ void perl_signals_init(void) perl_signal_args_partial = g_slist_append(perl_signal_args_partial, rec); } else { + int signal_id = signal_get_uniq_id(rec->signal); g_hash_table_insert(perl_signal_args_hash, - GINT_TO_POINTER(rec->signal_id), + GINT_TO_POINTER(signal_id), rec); } } |