Do not declare variables in a 'for' statement because the scope

of such variables is compiler-dependent.  (approved by kipp@netscape.com)
This commit is contained in:
wtc%netscape.com 1998-08-11 00:10:36 +00:00
parent ea6aa09a4e
commit dc2cd39331
2 changed files with 4 additions and 2 deletions

View File

@ -36,7 +36,8 @@ int main(int argc, char** argv)
nsIAtom** ids = new nsIAtom*[60000];
nsAutoString s1, s2;
PRTime start = PR_Now();
for (PRInt32 i = 0; i < 60000; i++) {
PRInt32 i;
for (i = 0; i < 60000; i++) {
char buf[1000];
char* s = fgets(buf, sizeof(buf), fp);
if (nsnull == s) {

View File

@ -36,7 +36,8 @@ int main(int argc, char** argv)
nsIAtom** ids = new nsIAtom*[60000];
nsAutoString s1, s2;
PRTime start = PR_Now();
for (PRInt32 i = 0; i < 60000; i++) {
PRInt32 i;
for (i = 0; i < 60000; i++) {
char buf[1000];
char* s = fgets(buf, sizeof(buf), fp);
if (nsnull == s) {