From cf54709a6b58640bfce102c313e365be563239e2 Mon Sep 17 00:00:00 2001 From: John Camelon Date: Fri, 26 Nov 2004 18:42:35 +0000 Subject: [PATCH] Changed default array sizes. --- .../cdt/internal/core/parser/scanner2/Scanner2.java | 12 ++++++++++++ .../cdt/internal/core/parser2/c/CASTDeclarator.java | 2 +- .../core/parser2/c/CASTFunctionDeclarator.java | 2 +- .../core/parser2/c/CASTSimpleDeclaration.java | 2 +- .../internal/core/parser2/cpp/CPPASTDeclarator.java | 2 +- .../core/parser2/cpp/CPPASTFunctionDeclarator.java | 2 +- .../core/parser2/cpp/CPPASTSimpleDeclaration.java | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java index c6648253fc1..707bf7db0b1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java @@ -3431,5 +3431,17 @@ public class Scanner2 implements IScanner, IScannerData { public int getCurrentOffset() { return bufferPos[ bufferStackPos ]; } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() { + StringBuffer buffer = new StringBuffer( "Scanner @ file:"); //$NON-NLS-1$ + buffer.append( getCurrentFilename() ); + buffer.append( " line: "); //$NON-NLS-1$ + buffer.append( getLineNumber( getCurrentOffset())); + return buffer.toString(); + } + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTDeclarator.java index dcb85b37432..1080d492adc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTDeclarator.java @@ -27,7 +27,7 @@ public class CASTDeclarator extends CASTNode implements IASTDeclarator { private IASTName name; private IASTDeclarator nestedDeclarator; private IASTPointerOperator [] pointerOps = null; - private static final int DEFAULT_PTROPS_LIST_SIZE = 4; + private static final int DEFAULT_PTROPS_LIST_SIZE = 2; private int currentIndex; private void removeNullPointers() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTFunctionDeclarator.java index 3b601146ac0..af4ba363066 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTFunctionDeclarator.java @@ -19,7 +19,7 @@ public class CASTFunctionDeclarator extends CASTDeclarator implements IASTFunctionDeclarator { private IASTParameterDeclaration [] parameters = null; - private static final int DEFAULT_PARAMETERS_LIST_SIZE = 4; + private static final int DEFAULT_PARAMETERS_LIST_SIZE = 2; private int currentIndex = 0; private boolean varArgs; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTSimpleDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTSimpleDeclaration.java index 9b900ede46b..1afbc96237c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTSimpleDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CASTSimpleDeclaration.java @@ -70,7 +70,7 @@ public class CASTSimpleDeclaration extends CASTNode implements private int currentIndex = 0; private IASTDeclarator [] declarators = null; - private static final int DEFAULT_DECLARATORS_LIST_SIZE = 4; + private static final int DEFAULT_DECLARATORS_LIST_SIZE = 2; private IASTDeclSpecifier declSpecifier; /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTDeclarator.java index 556e2f90945..7264135f94f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTDeclarator.java @@ -27,7 +27,7 @@ public class CPPASTDeclarator extends CPPASTNode implements IASTDeclarator { private IASTName name; private IASTDeclarator nestedDeclarator; private IASTPointerOperator [] pointerOps = null; - private static final int DEFAULT_PTROPS_LIST_SIZE = 4; + private static final int DEFAULT_PTROPS_LIST_SIZE = 2; private int currentIndex; private void removeNullPointers() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTFunctionDeclarator.java index 4814e438f89..34e6b889c18 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTFunctionDeclarator.java @@ -26,7 +26,7 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPASTFunctionDeclarator { private IASTParameterDeclaration [] parameters = null; - private static final int DEFAULT_PARAMETERS_LIST_SIZE = 4; + private static final int DEFAULT_PARAMETERS_LIST_SIZE = 2; private int currentIndex = 0; private boolean varArgs; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTSimpleDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTSimpleDeclaration.java index 106731cde0d..d59d221f5e8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTSimpleDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPASTSimpleDeclaration.java @@ -71,7 +71,7 @@ public class CPPASTSimpleDeclaration extends CPPASTNode implements private int currentIndex = 0; private IASTDeclarator [] declarators = null; - private static final int DEFAULT_DECLARATORS_LIST_SIZE = 4; + private static final int DEFAULT_DECLARATORS_LIST_SIZE = 2; private IASTDeclSpecifier declSpecifier; /**