mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
8fac40ce1b
commit
77e792334f
20 changed files with 552 additions and 566 deletions
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser;
|
package org.eclipse.cdt.internal.core.dom.parser;
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ import org.eclipse.cdt.internal.core.pdom.db.TypeMarshalBuffer;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents values of variables, enumerators or expressions. The primary purpose of the representation
|
* Represents values of variables, enumerators or expressions. The primary purpose of
|
||||||
* is to support instantiation of templates with non-type template parameters.
|
* the representation is to support instantiation of templates with non-type template parameters.
|
||||||
*/
|
*/
|
||||||
public class Value implements IValue {
|
public class Value implements IValue {
|
||||||
public static final int MAX_RECURSION_DEPTH = 25;
|
public static final int MAX_RECURSION_DEPTH = 25;
|
||||||
|
@ -858,7 +858,7 @@ public class Value implements IValue {
|
||||||
final int len= value.length;
|
final int len= value.length;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
boolean ok= false;
|
boolean ok= false;
|
||||||
for(; offset < len; offset++) {
|
for (; offset < len; offset++) {
|
||||||
final int digit= (value[offset] - '0');
|
final int digit= (value[offset] - '0');
|
||||||
if (digit < 0 || digit > 9)
|
if (digit < 0 || digit > 9)
|
||||||
break;
|
break;
|
||||||
|
@ -880,7 +880,7 @@ public class Value implements IValue {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
boolean ok= false;
|
boolean ok= false;
|
||||||
final int len= value.length;
|
final int len= value.length;
|
||||||
for(; offset < len; offset++) {
|
for (; offset < len; offset++) {
|
||||||
int digit= (value[offset] - '0');
|
int digit= (value[offset] - '0');
|
||||||
if (digit < 0 || digit > 9) {
|
if (digit < 0 || digit > 9) {
|
||||||
digit += '0' - 'a' + 10;
|
digit += '0' - 'a' + 10;
|
||||||
|
@ -917,7 +917,7 @@ public class Value implements IValue {
|
||||||
negative = true;
|
negative = true;
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
for(; offset < len; offset++) {
|
for (; offset < len; offset++) {
|
||||||
final int digit= (value[offset] - '0');
|
final int digit= (value[offset] - '0');
|
||||||
if (digit < 0 || digit > 9)
|
if (digit < 0 || digit > 9)
|
||||||
break;
|
break;
|
||||||
|
@ -951,7 +951,7 @@ public class Value implements IValue {
|
||||||
if (i == len)
|
if (i == len)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
for(; i < len; i++) {
|
for (; i < len; i++) {
|
||||||
if (result > maxvalue)
|
if (result > maxvalue)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -993,7 +993,7 @@ public class Value implements IValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IValue create(ICPPEvaluation eval, IASTNode point) {
|
public static IValue create(ICPPEvaluation eval, IASTNode point) {
|
||||||
// compute value of evaluation
|
// Compute value of evaluation
|
||||||
return Value.UNKNOWN;
|
return Value.UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -857,7 +857,8 @@ public class CPPTemplates {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IValue instantiateValue(IValue value, ICPPTemplateParameterMap tpMap, int packOffset, ICPPClassSpecialization within, int maxdepth, IASTNode point) {
|
public static IValue instantiateValue(IValue value, ICPPTemplateParameterMap tpMap, int packOffset,
|
||||||
|
ICPPClassSpecialization within, int maxdepth, IASTNode point) {
|
||||||
if (value == null)
|
if (value == null)
|
||||||
return null;
|
return null;
|
||||||
IBinding[] unknowns= value.getUnknownBindings();
|
IBinding[] unknowns= value.getUnknownBindings();
|
||||||
|
@ -2547,7 +2548,7 @@ public static IValue instantiateValue(IValue value, ICPPTemplateParameterMap tpM
|
||||||
Collections.reverse(defs);
|
Collections.reverse(defs);
|
||||||
|
|
||||||
ObjectMap result= new ObjectMap(keys.length);
|
ObjectMap result= new ObjectMap(keys.length);
|
||||||
for (int key: keys) {
|
for (int key : keys) {
|
||||||
int nestingLevel= key >> 16;
|
int nestingLevel= key >> 16;
|
||||||
int numParam= key & 0xffff;
|
int numParam= key & 0xffff;
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
@ -206,7 +205,6 @@ public class EvalBinary implements ICPPEvaluation {
|
||||||
return ExpressionTypes.restoreTypedefs(type, originalType1, originalType2);
|
return ExpressionTypes.restoreTypedefs(type, originalType1, originalType2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (fOperator) {
|
switch (fOperator) {
|
||||||
case op_arrayAccess:
|
case op_arrayAccess:
|
||||||
if (type1 instanceof IPointerType) {
|
if (type1 instanceof IPointerType) {
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.glvalueType;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.glvalueType;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromFunctionCall;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromFunctionCall;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
@ -30,8 +29,8 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* Performs evaluation of an expression.
|
* Performs evaluation of an expression.
|
||||||
*/
|
*/
|
||||||
public class EvalFixed implements ICPPEvaluation {
|
public class EvalFixed implements ICPPEvaluation {
|
||||||
public static final ICPPEvaluation INCOMPLETE = new EvalFixed(
|
public static final ICPPEvaluation INCOMPLETE =
|
||||||
ProblemType.UNKNOWN_FOR_EXPRESSION, PRVALUE, Value.UNKNOWN);
|
new EvalFixed(ProblemType.UNKNOWN_FOR_EXPRESSION, PRVALUE, Value.UNKNOWN);
|
||||||
|
|
||||||
private final IType fType;
|
private final IType fType;
|
||||||
private final IValue fValue;
|
private final IValue fValue;
|
||||||
|
@ -108,7 +107,7 @@ public class EvalFixed implements ICPPEvaluation {
|
||||||
int firstByte = ITypeMarshalBuffer.EVAL_FIXED;
|
int firstByte = ITypeMarshalBuffer.EVAL_FIXED;
|
||||||
if (includeValue)
|
if (includeValue)
|
||||||
firstByte |= ITypeMarshalBuffer.FLAG1;
|
firstByte |= ITypeMarshalBuffer.FLAG1;
|
||||||
switch(fValueCategory) {
|
switch (fValueCategory) {
|
||||||
case LVALUE:
|
case LVALUE:
|
||||||
firstByte |= ITypeMarshalBuffer.FLAG2;
|
firstByte |= ITypeMarshalBuffer.FLAG2;
|
||||||
break;
|
break;
|
||||||
|
@ -131,15 +130,15 @@ public class EvalFixed implements ICPPEvaluation {
|
||||||
IValue value;
|
IValue value;
|
||||||
ValueCategory cat;
|
ValueCategory cat;
|
||||||
switch (firstByte & (ITypeMarshalBuffer.FLAG2 | ITypeMarshalBuffer.FLAG3)) {
|
switch (firstByte & (ITypeMarshalBuffer.FLAG2 | ITypeMarshalBuffer.FLAG3)) {
|
||||||
case ITypeMarshalBuffer.FLAG2:
|
case ITypeMarshalBuffer.FLAG2:
|
||||||
cat= LVALUE;
|
cat= LVALUE;
|
||||||
break;
|
break;
|
||||||
case ITypeMarshalBuffer.FLAG3:
|
case ITypeMarshalBuffer.FLAG3:
|
||||||
cat= PRVALUE;
|
cat= PRVALUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cat= XVALUE;
|
cat= XVALUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
IType type= buffer.unmarshalType();
|
IType type= buffer.unmarshalType();
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromReturnType;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromReturnType;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromReturnType;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromReturnType;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
|
@ -29,13 +29,13 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* For marshalling types to byte arrays.
|
* For marshalling types to byte arrays.
|
||||||
*/
|
*/
|
||||||
public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
public final static byte[] EMPTY= { 0, 0, 0, 0, 0, 0 };
|
public static final byte[] EMPTY= { 0, 0, 0, 0, 0, 0 };
|
||||||
public final static byte NULL_TYPE= 0;
|
public static final byte NULL_TYPE= 0;
|
||||||
public final static byte INDIRECT_TYPE= (byte) -1;
|
public static final byte INDIRECT_TYPE= (byte) -1;
|
||||||
public final static byte BINDING_TYPE= (byte) -2;
|
public static final byte BINDING_TYPE= (byte) -2;
|
||||||
public final static byte UNSTORABLE_TYPE= (byte) -3;
|
public static final byte UNSTORABLE_TYPE= (byte) -3;
|
||||||
|
|
||||||
public final static IType UNSTORABLE_TYPE_PROBLEM = new ProblemType(ISemanticProblem.TYPE_NOT_PERSISTED);
|
public static final IType UNSTORABLE_TYPE_PROBLEM = new ProblemType(ISemanticProblem.TYPE_NOT_PERSISTED);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
assert EMPTY.length == Database.TYPE_SIZE;
|
assert EMPTY.length == Database.TYPE_SIZE;
|
||||||
|
@ -129,7 +129,7 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
|
|
||||||
byte firstByte= fBuffer[fPos];
|
byte firstByte= fBuffer[fPos];
|
||||||
if (firstByte == BINDING_TYPE) {
|
if (firstByte == BINDING_TYPE) {
|
||||||
fPos+= 2;
|
fPos += 2;
|
||||||
long rec= getRecordPointer();
|
long rec= getRecordPointer();
|
||||||
return (IType) fLinkage.getNode(rec);
|
return (IType) fLinkage.getNode(rec);
|
||||||
} else if (firstByte == NULL_TYPE) {
|
} else if (firstByte == NULL_TYPE) {
|
||||||
|
@ -209,7 +209,7 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getByte() throws CoreException {
|
public int getByte() throws CoreException {
|
||||||
if (fPos+1 > fBuffer.length)
|
if (fPos + 1 > fBuffer.length)
|
||||||
throw unmarshallingError();
|
throw unmarshallingError();
|
||||||
return 0xff & fBuffer[fPos++];
|
return 0xff & fBuffer[fPos++];
|
||||||
}
|
}
|
||||||
|
@ -218,6 +218,7 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
public CoreException unmarshallingError() {
|
public CoreException unmarshallingError() {
|
||||||
return new CoreException(CCorePlugin.createStatus("Unmarshalling error")); //$NON-NLS-1$
|
return new CoreException(CCorePlugin.createStatus("Unmarshalling error")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreException marshallingError() {
|
public CoreException marshallingError() {
|
||||||
return new CoreException(CCorePlugin.createStatus("Marshalling error")); //$NON-NLS-1$
|
return new CoreException(CCorePlugin.createStatus("Marshalling error")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -225,13 +226,13 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
@Override
|
@Override
|
||||||
public void putShort(short value) {
|
public void putShort(short value) {
|
||||||
request(2);
|
request(2);
|
||||||
fBuffer[fPos++]= (byte)(value >> 8);
|
fBuffer[fPos++]= (byte) (value >> 8);
|
||||||
fBuffer[fPos++]= (byte)(value);
|
fBuffer[fPos++]= (byte) (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getShort() throws CoreException {
|
public int getShort() throws CoreException {
|
||||||
if (fPos+2 > fBuffer.length)
|
if (fPos + 2 > fBuffer.length)
|
||||||
throw unmarshallingError();
|
throw unmarshallingError();
|
||||||
final int byte1 = 0xff & fBuffer[fPos++];
|
final int byte1 = 0xff & fBuffer[fPos++];
|
||||||
final int byte2 = 0xff & fBuffer[fPos++];
|
final int byte2 = 0xff & fBuffer[fPos++];
|
||||||
|
@ -242,14 +243,14 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
request(4);
|
request(4);
|
||||||
fPos += 4;
|
fPos += 4;
|
||||||
int p= fPos;
|
int p= fPos;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value);
|
fBuffer[--p]= (byte) (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getInt() throws CoreException {
|
public int getInt() throws CoreException {
|
||||||
if (fPos+4 > fBuffer.length)
|
if (fPos + 4 > fBuffer.length)
|
||||||
throw unmarshallingError();
|
throw unmarshallingError();
|
||||||
int result= 0;
|
int result= 0;
|
||||||
result |= fBuffer[fPos++] & 0xff; result <<= 8;
|
result |= fBuffer[fPos++] & 0xff; result <<= 8;
|
||||||
|
@ -264,19 +265,19 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
request(8);
|
request(8);
|
||||||
fPos += 8;
|
fPos += 8;
|
||||||
int p= fPos;
|
int p= fPos;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value); value >>= 8;
|
fBuffer[--p]= (byte) (value); value >>= 8;
|
||||||
fBuffer[--p]= (byte)(value);
|
fBuffer[--p]= (byte) (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getLong() throws CoreException {
|
public long getLong() throws CoreException {
|
||||||
if (fPos+8 > fBuffer.length)
|
if (fPos + 8 > fBuffer.length)
|
||||||
throw unmarshallingError();
|
throw unmarshallingError();
|
||||||
long result= 0;
|
long result= 0;
|
||||||
result |= fBuffer[fPos++] & 0xff; result <<= 8;
|
result |= fBuffer[fPos++] & 0xff; result <<= 8;
|
||||||
|
@ -293,7 +294,7 @@ public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
private void putRecordPointer(long record) {
|
private void putRecordPointer(long record) {
|
||||||
request(Database.PTR_SIZE);
|
request(Database.PTR_SIZE);
|
||||||
Chunk.putRecPtr(record, fBuffer, fPos);
|
Chunk.putRecPtr(record, fBuffer, fPos);
|
||||||
fPos+= Database.PTR_SIZE;
|
fPos += Database.PTR_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getRecordPointer() throws CoreException {
|
private long getRecordPointer() throws CoreException {
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
||||||
|
@ -119,6 +114,11 @@ import org.eclipse.cdt.internal.core.pdom.dom.PDOMName;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for c++-entities.
|
* Container for c++-entities.
|
||||||
*/
|
*/
|
||||||
|
@ -1046,7 +1046,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
@Override
|
@Override
|
||||||
public IType unmarshalType(ITypeMarshalBuffer buffer) throws CoreException {
|
public IType unmarshalType(ITypeMarshalBuffer buffer) throws CoreException {
|
||||||
int firstByte= buffer.getByte();
|
int firstByte= buffer.getByte();
|
||||||
switch((firstByte & ITypeMarshalBuffer.KIND_MASK)) {
|
switch ((firstByte & ITypeMarshalBuffer.KIND_MASK)) {
|
||||||
case ITypeMarshalBuffer.ARRAY_TYPE:
|
case ITypeMarshalBuffer.ARRAY_TYPE:
|
||||||
return CPPArrayType.unmarshal(firstByte, buffer);
|
return CPPArrayType.unmarshal(firstByte, buffer);
|
||||||
case ITypeMarshalBuffer.BASIC_TYPE:
|
case ITypeMarshalBuffer.BASIC_TYPE:
|
||||||
|
@ -1075,7 +1075,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
@Override
|
@Override
|
||||||
public ISerializableEvaluation unmarshalEvaluation(ITypeMarshalBuffer buffer) throws CoreException {
|
public ISerializableEvaluation unmarshalEvaluation(ITypeMarshalBuffer buffer) throws CoreException {
|
||||||
int firstByte= buffer.getByte();
|
int firstByte= buffer.getByte();
|
||||||
switch((firstByte & ITypeMarshalBuffer.KIND_MASK)) {
|
switch ((firstByte & ITypeMarshalBuffer.KIND_MASK)) {
|
||||||
case ITypeMarshalBuffer.EVAL_BINARY:
|
case ITypeMarshalBuffer.EVAL_BINARY:
|
||||||
return EvalBinary.unmarshal(firstByte, buffer);
|
return EvalBinary.unmarshal(firstByte, buffer);
|
||||||
case ITypeMarshalBuffer.EVAL_BINARY_TYPE_ID:
|
case ITypeMarshalBuffer.EVAL_BINARY_TYPE_ID:
|
||||||
|
|
Loading…
Add table
Reference in a new issue