From: Panayotis Skordos Date: Sun, 14 Feb 1988 20:16:01 +0000 (+0000) Subject: macro-improvements: macro local variables X-Git-Tag: 20090517-FFI~12901 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=0235b16e5eed2c2eca1adcf2ecc45d7963593929;p=mit-scheme.git macro-improvements: macro local variables --- diff --git a/v7/src/microcode/array.h b/v7/src/microcode/array.h index 82eecb2b7..f96919975 100644 --- a/v7/src/microcode/array.h +++ b/v7/src/microcode/array.h @@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising, promotional, or sales literature without prior written consent from MIT in each case. */ -/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/array.h,v 9.25 1988/01/07 19:17:54 pas Exp $ */ +/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/array.h,v 9.26 1988/02/14 20:16:01 pas Rel $ */ #define REAL float @@ -75,36 +75,42 @@ MIT in each case. */ #define ARRAY_MAX_LENGTH 1000000 /* This is 4 Mbytes for what it's worth... */ -/* The following Macros implement useful procs on arrays - Note: The running index "MCRINDX" in the macro loops has been chosen - so as to avoid name shadowing other variables when substituted. +/* The following macros implement commonly used array procs. */ + +/* In the following macros we assign the arguments to local variables + so as to do any computation (referencing, etc.) only once outside the loop. + Otherwise it would be done again and again inside the loop -- look at "cc -v -S -O" to see the difference + */ +/* The names, like "MCRINDX", have been chosen to avoid shadowing the variables that are substituted in. + WARNING: Do not use any names starting with the prefix "mcr", when calling these macros */ -#define C_Array_Scale(a,scale, len) \ -{ register long mcrindx; \ - for (mcrindx=0;mcrindx