From 7dbb8efdde3720fd15f06de088848259e24e3397 Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Sun, 6 Nov 2011 20:47:00 +0100 Subject: get rid of PL_na --- src/perl/common/Core.xs | 16 ++++++++-------- src/perl/common/Expando.xs | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/perl/common') diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs index 76ea0093..719c0303 100644 --- a/src/perl/common/Core.xs +++ b/src/perl/common/Core.xs @@ -48,11 +48,11 @@ static void handle_command_bind(int priority, int items, SV *p0, SV *p1, SV *p2) if (!hash) { category = items < 3 ? DEFAULT_COMMAND_CATEGORY : - (char *)SvPV(p2, PL_na); - perl_command_bind_to((char *)SvPV(p0, PL_na), category, p1, priority); + (char *)SvPV_nolen(p2); + perl_command_bind_to((char *)SvPV_nolen(p0), category, p1, priority); } else { category = items < 2 ? DEFAULT_COMMAND_CATEGORY : - (char *)SvPV(p1, PL_na); + (char *)SvPV_nolen(p1); perl_command_bind_add_hash(priority, p0, category); } } @@ -116,7 +116,7 @@ CODE: if (items != 1 && items != 2) croak("Usage: Irssi::signal_add(signal, func)"); if (items == 2) - perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1), + perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), SIGNAL_PRIORITY_DEFAULT); else perl_signal_add_hash(SIGNAL_PRIORITY_DEFAULT, ST(0)); @@ -127,7 +127,7 @@ CODE: if (items != 1 && items != 2) croak("Usage: Irssi::signal_add_first(signal, func)"); if (items == 2) - perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1), + perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), SIGNAL_PRIORITY_HIGH); else perl_signal_add_hash(SIGNAL_PRIORITY_HIGH, ST(0)); @@ -138,7 +138,7 @@ CODE: if (items != 1 && items != 2) croak("Usage: Irssi::signal_add_last(signal, func)"); if (items == 2) - perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1), + perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), SIGNAL_PRIORITY_LOW); else perl_signal_add_hash(SIGNAL_PRIORITY_LOW, ST(0)); @@ -149,7 +149,7 @@ CODE: if (items != 2 && items != 3) croak("Usage: Irssi::signal_add_priority(signal, func, priority)"); if (items == 3) - perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1), SvIV(ST(2))); + perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), SvIV(ST(2))); else perl_signal_add_hash(SvIV(ST(0)), ST(1)); @@ -179,7 +179,7 @@ CODE: if (len > 6) len = 6; for (pos = 0; pos < len; pos++) { SV **val = av_fetch(av, pos, 0); - arr[pos] = SvPV(*val, PL_na); + arr[pos] = SvPV_nolen(*val); } arr[pos] = NULL; perl_signal_register(key, arr); diff --git a/src/perl/common/Expando.xs b/src/perl/common/Expando.xs index 31b4f990..10d85d24 100644 --- a/src/perl/common/Expando.xs +++ b/src/perl/common/Expando.xs @@ -77,7 +77,7 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server, if (rec->script != NULL) script_unregister_expandos(rec->script); - signal_emit("script error", 2, rec->script, SvPV(ERRSV, PL_na)); + signal_emit("script error", 2, rec->script, SvPV_nolen(ERRSV)); } else if (retcount > 0) { ret = g_strdup(POPp); *free_ret = TRUE; @@ -117,7 +117,7 @@ static void expando_signals_add_hash(const char *key, SV *signals) hv_iterinit(hv); while ((he = hv_iternext(hv)) != NULL) { SV *argsv = HeVAL(he); - argstr = SvPV(argsv, PL_na); + argstr = SvPV_nolen(argsv); if (g_ascii_strcasecmp(argstr, "none") == 0) arg = EXPANDO_ARG_NONE; -- cgit v1.2.3 From f58a461c54f2189543d64303e8c80bacda78448d Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Wed, 25 Jun 2014 03:17:03 +0200 Subject: cleanup char* casts and replace one useless SvPV with SvPV_nolen --- src/perl/common/Core.xs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/perl/common') diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs index 719c0303..3358f5eb 100644 --- a/src/perl/common/Core.xs +++ b/src/perl/common/Core.xs @@ -48,11 +48,11 @@ static void handle_command_bind(int priority, int items, SV *p0, SV *p1, SV *p2) if (!hash) { category = items < 3 ? DEFAULT_COMMAND_CATEGORY : - (char *)SvPV_nolen(p2); - perl_command_bind_to((char *)SvPV_nolen(p0), category, p1, priority); + SvPV_nolen(p2); + perl_command_bind_to(SvPV_nolen(p0), category, p1, priority); } else { category = items < 2 ? DEFAULT_COMMAND_CATEGORY : - (char *)SvPV_nolen(p1); + SvPV_nolen(p1); perl_command_bind_add_hash(priority, p0, category); } } @@ -116,7 +116,7 @@ CODE: if (items != 1 && items != 2) croak("Usage: Irssi::signal_add(signal, func)"); if (items == 2) - perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), + perl_signal_add_full(SvPV_nolen(ST(0)), ST(1), SIGNAL_PRIORITY_DEFAULT); else perl_signal_add_hash(SIGNAL_PRIORITY_DEFAULT, ST(0)); @@ -127,7 +127,7 @@ CODE: if (items != 1 && items != 2) croak("Usage: Irssi::signal_add_first(signal, func)"); if (items == 2) - perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), + perl_signal_add_full(SvPV_nolen(ST(0)), ST(1), SIGNAL_PRIORITY_HIGH); else perl_signal_add_hash(SIGNAL_PRIORITY_HIGH, ST(0)); @@ -138,7 +138,7 @@ CODE: if (items != 1 && items != 2) croak("Usage: Irssi::signal_add_last(signal, func)"); if (items == 2) - perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), + perl_signal_add_full(SvPV_nolen(ST(0)), ST(1), SIGNAL_PRIORITY_LOW); else perl_signal_add_hash(SIGNAL_PRIORITY_LOW, ST(0)); @@ -149,7 +149,7 @@ CODE: if (items != 2 && items != 3) croak("Usage: Irssi::signal_add_priority(signal, func, priority)"); if (items == 3) - perl_signal_add_full((char *)SvPV_nolen(ST(0)), ST(1), SvIV(ST(2))); + perl_signal_add_full(SvPV_nolen(ST(0)), ST(1), SvIV(ST(2))); else perl_signal_add_hash(SvIV(ST(0)), ST(1)); -- cgit v1.2.3