diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-08-16 10:50:14 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-08-18 11:26:37 -0600 |
commit | eb578fdb5569b91c28466a4d1939e381ff6ceaf4 (patch) | |
tree | cb76dfdd15ead716ff76b6a46eb1c49f10b302f2 /NetWare | |
parent | 29205e9cdf0a179ed7a2e9401a3b19c8ede062db (diff) | |
download | perl-eb578fdb5569b91c28466a4d1939e381ff6ceaf4.tar.gz |
Omnibus removal of register declarations
This removes most register declarations in C code (and accompanying
documentation) in the Perl core. Retained are those in the ext
directory, Configure, and those that are associated with assembly
language.
See:
http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c
which says, in part:
There is no good example of register usage when using modern compilers
(read: last 10+ years) because it almost never does any good and can do
some bad. When you use register, you are telling the compiler "I know
how to optimize my code better than you do" which is almost never the
case. One of three things can happen when you use register:
The compiler ignores it, this is most likely. In this case the only
harm is that you cannot take the address of the variable in the
code.
The compiler honors your request and as a result the code runs slower.
The compiler honors your request and the code runs faster, this is the least likely scenario.
Even if one compiler produces better code when you use register, there
is no reason to believe another will do the same. If you have some
critical code that the compiler is not optimizing well enough your best
bet is probably to use assembler for that part anyway but of course do
the appropriate profiling to verify the generated code is really a
problem first.
Diffstat (limited to 'NetWare')
-rw-r--r-- | NetWare/NWUtil.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/NetWare/NWUtil.c b/NetWare/NWUtil.c index 15e90cb481..6d60dfbabd 100644 --- a/NetWare/NWUtil.c +++ b/NetWare/NWUtil.c @@ -517,8 +517,8 @@ void fnAppendArgument(PCOMMANDLINEPARSER pclp, char *new_arg) char *fnSkipToken(char *s, char *r) { - register char *t=NULL; - register char quote = '\0'; // NULL, single quote, or double quote + char *t=NULL; + char quote = '\0'; // NULL, single quote, or double quote char ch = '\0'; for (t=s; t[0]; t++) @@ -577,11 +577,11 @@ char *fnSkipToken(char *s, char *r) char *fnScanToken(char *x, char *r) { - register char *s = x; // input string position - register char *t = x; // output string position - register char quote = '\0'; // either NULL, or single quote, or double quote - register char ch = '\0'; - register char c = '\0'; + char *s = x; // input string position + char *t = x; // output string position + char quote = '\0'; // either NULL, or single quote, or double quote + char ch = '\0'; + char c = '\0'; while (*s) { |