mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Cosmetics.
This commit is contained in:
parent
c516d8d4ab
commit
3fb603c849
2 changed files with 14 additions and 19 deletions
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Rational Software - Initial API and implementation
|
* Rational Software - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.model;
|
package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
|
@ -23,5 +22,4 @@ public class Function extends FunctionDeclaration implements IFunction {
|
||||||
public Function(ICElement parent, String name, int kind) {
|
public Function(ICElement parent, String name, int kind) {
|
||||||
super(parent, name, kind);
|
super(parent, name, kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.model;
|
package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
import org.eclipse.cdt.core.model.CModelException;
|
||||||
|
@ -32,14 +31,14 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getReturnType(){
|
public String getReturnType() {
|
||||||
if (returnType != null) {
|
if (returnType != null) {
|
||||||
return returnType;
|
return returnType;
|
||||||
}
|
}
|
||||||
return ""; //$NON-NLS-1$
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReturnType(String type){
|
public void setReturnType(String type) {
|
||||||
returnType = type;
|
returnType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,12 +62,12 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getSignature(IFunctionDeclaration func) {
|
public static String getSignature(IFunctionDeclaration func) {
|
||||||
StringBuffer sig = new StringBuffer(func.getElementName());
|
StringBuilder sig = new StringBuilder(func.getElementName());
|
||||||
sig.append(getParameterClause(func.getParameterTypes()));
|
sig.append(getParameterClause(func.getParameterTypes()));
|
||||||
try {
|
try {
|
||||||
if(func.isConst())
|
if (func.isConst())
|
||||||
sig.append(" const"); //$NON-NLS-1$
|
sig.append(" const"); //$NON-NLS-1$
|
||||||
if(func.isVolatile()) {
|
if (func.isVolatile()) {
|
||||||
sig.append(" volatile"); //$NON-NLS-1$
|
sig.append(" volatile"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
} catch (CModelException e) {
|
} catch (CModelException e) {
|
||||||
|
@ -80,20 +79,19 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
|
||||||
return getParameterClause(getParameterTypes());
|
return getParameterClause(getParameterTypes());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getParameterClause(String[] paramTypes){
|
public static String getParameterClause(String[] paramTypes) {
|
||||||
StringBuffer sig = new StringBuffer();
|
StringBuilder sig = new StringBuilder();
|
||||||
|
|
||||||
if(paramTypes.length > 0){
|
if (paramTypes.length > 0) {
|
||||||
sig.append("("); //$NON-NLS-1$
|
sig.append("("); //$NON-NLS-1$
|
||||||
int i = 0;
|
int i = 0;
|
||||||
sig.append(paramTypes[i++]);
|
sig.append(paramTypes[i++]);
|
||||||
while (i < paramTypes.length){
|
while (i < paramTypes.length) {
|
||||||
sig.append(", "); //$NON-NLS-1$
|
sig.append(", "); //$NON-NLS-1$
|
||||||
sig.append(paramTypes[i++]);
|
sig.append(paramTypes[i++]);
|
||||||
}
|
}
|
||||||
sig.append(")"); //$NON-NLS-1$
|
sig.append(")"); //$NON-NLS-1$
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
sig.append("()"); //$NON-NLS-1$
|
sig.append("()"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return sig.toString();
|
return sig.toString();
|
||||||
|
@ -105,12 +103,12 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getExceptions(){
|
public String[] getExceptions() {
|
||||||
return new String[] {};
|
return new String[] {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CElementInfo createElementInfo () {
|
protected CElementInfo createElementInfo() {
|
||||||
return new FunctionInfo(this);
|
return new FunctionInfo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,5 +185,4 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
|
||||||
escapeMementoName(buff, fParameterTypes[i]);
|
escapeMementoName(buff, fParameterTypes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue