diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java index c8ad3e80bac..bd079ec9b74 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java @@ -50,26 +50,26 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction } public String getSignature(){ - String sig = getElementName(); + StringBuffer sig = new StringBuffer(getElementName()); if(getNumberOfParameters() > 0){ - sig += "("; + sig.append("("); String[] paramTypes = getParameterTypes(); int i = 0; - sig += paramTypes[i++]; + sig.append(paramTypes[i++]); while (i < paramTypes.length){ - sig += (", "); - sig += paramTypes[i++]; + sig.append(", "); + sig.append(paramTypes[i++]); } - sig += ")"; + sig.append(")"); } else{ - sig += "()"; + sig.append("()"); } if(isConst()) - sig += " const"; + sig.append(" const"); if(isVolatile()) - sig += " volatile"; - return sig; + sig.append(" volatile"); + return sig.toString(); } public String getParameterInitializer(int pos) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java index e74a32642c5..c331a7ab740 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/CModelBuilder.java @@ -372,75 +372,75 @@ public class CModelBuilder { } private String getType(Declaration declaration, Declarator declarator){ - String type = ""; + StringBuffer type = new StringBuffer(); // get type from declaration - type = getDeclarationType(declaration); + type.append(getDeclarationType(declaration)); // add pointerr or reference from declarator if any - type += getDeclaratorPointerOperation(declarator); - return type; + type.append(getDeclaratorPointerOperation(declarator)); + return type.toString(); } private String getDeclarationType(Declaration declaration){ - String type = ""; + StringBuffer type = new StringBuffer(); if(declaration instanceof ParameterDeclaration){ ParameterDeclaration paramDeclaration = (ParameterDeclaration) declaration; if(paramDeclaration.getDeclSpecifier().isConst()) - type += "const "; + type.append("const "); if(paramDeclaration.getDeclSpecifier().isVolatile()) - type += "volatile "; + type.append("volatile "); TypeSpecifier typeSpecifier = paramDeclaration.getTypeSpecifier(); if(typeSpecifier == null){ - type += paramDeclaration.getDeclSpecifier().getTypeName(); + type.append(paramDeclaration.getDeclSpecifier().getTypeName()); } else if(typeSpecifier instanceof ElaboratedTypeSpecifier){ ElaboratedTypeSpecifier elab = (ElaboratedTypeSpecifier) typeSpecifier; - type += getElaboratedTypeSignature(elab); + type.append(getElaboratedTypeSignature(elab)); } } if(declaration instanceof SimpleDeclaration){ SimpleDeclaration simpleDeclaration = (SimpleDeclaration) declaration; if(simpleDeclaration.getDeclSpecifier().isConst()) - type += "const "; + type.append("const "); if(simpleDeclaration.getDeclSpecifier().isVolatile()) - type += "volatile "; + type.append("volatile "); TypeSpecifier typeSpecifier = simpleDeclaration.getTypeSpecifier(); if(typeSpecifier == null){ - type += simpleDeclaration.getDeclSpecifier().getTypeName(); + type.append(simpleDeclaration.getDeclSpecifier().getTypeName()); } else if(typeSpecifier instanceof ElaboratedTypeSpecifier){ ElaboratedTypeSpecifier elab = (ElaboratedTypeSpecifier) typeSpecifier; - type += getElaboratedTypeSignature(elab); + type.append(getElaboratedTypeSignature(elab)); } } - return type; + return type.toString(); } private String getElaboratedTypeSignature(ElaboratedTypeSpecifier elab){ - String type = ""; + StringBuffer type = new StringBuffer(); int t = elab.getClassKey(); switch (t){ case ClassKey.t_class: - type = "class"; + type.append("class"); break; case ClassKey.t_struct: - type = "struct"; + type.append("struct"); break; case ClassKey.t_union: - type = "union"; + type.append("union"); break; case ClassKey.t_enum: - type = "enum"; + type.append("enum"); break; }; - type += " "; - type += elab.getName().toString(); - return type; + type.append(" "); + type.append(elab.getName().toString()); + return type.toString(); } private String getDeclaratorPointerOperation(Declarator declarator){ - String pointerString = ""; + StringBuffer pointerString = new StringBuffer(); List pointerOperators = declarator.getPointerOperators(); if(pointerOperators != null) { Iterator i = pointerOperators.iterator(); @@ -448,19 +448,19 @@ public class CModelBuilder { PointerOperator po = (PointerOperator) i.next(); switch (po.getType()){ case PointerOperator.t_pointer: - pointerString += "*"; + pointerString.append("*"); break; case PointerOperator.t_reference: - pointerString += "&"; + pointerString.append("&"); break; } if(po.isConst()) - pointerString += " const"; + pointerString.append(" const"); if(po.isVolatile()) - pointerString += " volatile"; + pointerString.append(" volatile"); } } - return pointerString; + return pointerString.toString(); } } diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif index c175692aaba..3ce0d82ebc4 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif and b/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif index 36b599585ee..a73f31a81f6 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif and b/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif index f93b646ddb1..7e3ace3e77b 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif and b/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif index 8ac3c0a1d1d..74a3d222c70 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif and b/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif index d15ab503ebe..ae434bfb4c5 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif and b/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif index 08438a590ab..6b6a2a08343 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif and b/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif index 8ddf0be719c..4f4b767665c 100644 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif and b/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif differ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java index 3932d826b6e..c79e22aea1f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java @@ -124,6 +124,7 @@ public class CPluginImages { public static final ImageDescriptor DESC_OVR_STATIC= create(T_OVR, "static_co.gif"); public static final ImageDescriptor DESC_OVR_CONSTANT= create(T_OVR, "c_ovr.gif"); + public static final ImageDescriptor DESC_OVR_VOLATILE= create(T_OVR, "volatile_co.gif"); public static final ImageDescriptor DESC_OVR_WARNING= create(T_OVR, "warning_co.gif"); public static final ImageDescriptor DESC_OVR_ERROR= create(T_OVR, "error_co.gif"); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java index bfc3f17c620..d8309d2eccc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java @@ -162,11 +162,11 @@ public class CElementImageDescriptor extends CompositeImageDescriptor { private void drawTopRight() { int x= getSize().x; ImageData data= null; - /* if ((fFlags & ABSTRACT) != 0) { - data= CPluginImages.DESC_OVR_ABSTRACT.getImageData(); + if ((fFlags & VOLATILE) != 0) { + data= CPluginImages.DESC_OVR_VOLATILE.getImageData(); x-= data.width; drawImage(data, x, 0); - }*/ + } if ((fFlags & CONSTANT) != 0) { data= CPluginImages.DESC_OVR_CONSTANT.getImageData(); x-= data.width; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java index 5066b9c5dfa..0e205b1b92e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java @@ -60,16 +60,16 @@ public class CElementLabelProvider extends LabelProvider { if (element instanceof ICElement) { ICElement celem= (ICElement)element; - String name = ""; + StringBuffer name = new StringBuffer(); switch(celem.getElementType()){ case ICElement.C_FIELD: case ICElement.C_VARIABLE: case ICElement.C_VARIABLE_DECLARATION: IVariableDeclaration vDecl = (IVariableDeclaration) celem; - name = vDecl.getElementName(); + name.append(vDecl.getElementName()); if((vDecl.getTypeName() != null) &&(vDecl.getTypeName().length() > 0)){ - name += " : "; - name += vDecl.getTypeName(); + name.append(" : "); + name.append(vDecl.getTypeName()); } break; case ICElement.C_FUNCTION: @@ -77,48 +77,48 @@ public class CElementLabelProvider extends LabelProvider { case ICElement.C_METHOD: case ICElement.C_METHOD_DECLARATION: IFunctionDeclaration fDecl = (IFunctionDeclaration) celem; - name = fDecl.getSignature(); + name.append(fDecl.getSignature()); if((fDecl.getReturnType() != null) &&(fDecl.getReturnType().length() > 0)){ - name += " : "; - name += fDecl.getReturnType(); + name.append(" : "); + name.append(fDecl.getReturnType()); } break; case ICElement.C_STRUCT: case ICElement.C_UNION: case ICElement.C_ENUMERATION: if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){ - name = celem.getElementName(); + name.append(celem.getElementName()); } else if (celem instanceof IVariableDeclaration) { IVariableDeclaration varDecl = (IVariableDeclaration) celem; - name = varDecl.getTypeName(); + name.append(varDecl.getTypeName()); } break; case ICElement.C_TYPEDEF: ITypeDef tDecl = (ITypeDef) celem; - name = tDecl.getElementName(); + name.append(tDecl.getElementName()); if((tDecl.getTypeName() != null) &&(tDecl.getTypeName().length() > 0)){ - name += " : "; - name += tDecl.getTypeName(); + name.append(" : "); + name.append(tDecl.getTypeName()); } break; case ICElement.C_NAMESPACE: if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){ - name = celem.getElementName(); + name.append(celem.getElementName()); } else if (celem instanceof INamespace) { INamespace nDecl = (INamespace) celem; - name = nDecl.getTypeName(); + name.append(nDecl.getTypeName()); } break; default: - name= celem.getElementName(); + name.append(celem.getElementName()); break; } if (celem instanceof IBinary) { IBinary bin = (IBinary)celem; - name += " - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"; + name.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); } - return name; + return name.toString(); } return fWorkbenchLabelProvider.getText(element); }