summaryrefslogtreecommitdiffstats
path: root/perl-install/Newt
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-12-14 11:37:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-12-14 11:37:18 +0000
commit3638fb314f9458f66244795b766e5fd0e341110e (patch)
tree636375489765c68473442fbe6fda1b6d574e09ea /perl-install/Newt
parente6850e7708cb4a570635e0a1fc0b95f46c418176 (diff)
downloaddrakx-backup-do-not-use-3638fb314f9458f66244795b766e5fd0e341110e.tar
drakx-backup-do-not-use-3638fb314f9458f66244795b766e5fd0e341110e.tar.gz
drakx-backup-do-not-use-3638fb314f9458f66244795b766e5fd0e341110e.tar.bz2
drakx-backup-do-not-use-3638fb314f9458f66244795b766e5fd0e341110e.tar.xz
drakx-backup-do-not-use-3638fb314f9458f66244795b766e5fd0e341110e.zip
cleanup (use of alloca to pass parameters)
Diffstat (limited to 'perl-install/Newt')
-rw-r--r--perl-install/Newt/Newt.xs23
1 files changed, 7 insertions, 16 deletions
diff --git a/perl-install/Newt/Newt.xs b/perl-install/Newt/Newt.xs
index 97c056ee6..0b34fab69 100644
--- a/perl-install/Newt/Newt.xs
+++ b/perl-install/Newt/Newt.xs
@@ -369,22 +369,13 @@ HCloseStacked(first, ...)
CODE:
{
int i;
-#define a(i) (newtComponent)SvIV((SV*)SvRV( ST(i) ))
- RETVAL =
- newtGridHCloseStacked(
- items > 0 ? 1 : 0, items > 0 ? a( 0) : NULL,
- items > 1 ? 1 : 0, items > 1 ? a( 1) : NULL,
- items > 2 ? 1 : 0, items > 2 ? a( 2) : NULL,
- items > 3 ? 1 : 0, items > 3 ? a( 3) : NULL,
- items > 4 ? 1 : 0, items > 4 ? a( 4) : NULL,
- items > 5 ? 1 : 0, items > 5 ? a( 5) : NULL,
- items > 6 ? 1 : 0, items > 6 ? a( 6) : NULL,
- items > 7 ? 1 : 0, items > 7 ? a( 7) : NULL,
- items > 8 ? 1 : 0, items > 8 ? a( 8) : NULL,
- items > 9 ? 1 : 0, items > 9 ? a( 9) : NULL,
- items > 10 ? 1 : 0, items > 10 ? a(10) : NULL,
- NULL);
-#undef a
+ newtComponent *p = alloca(sizeof(newtComponent) * (2 * items + 1));
+ for (i = 0; i < items; i++) {
+ p[2 * i] = 1;
+ p[2 * i + 1] = (newtComponent)SvIV((SV*)SvRV( ST(i) ));
+ }
+ p[2 * items] = NULL;
+ RETVAL = ((newtGrid (*)()) newtGridHCloseStacked)();
}
OUTPUT:
RETVAL