1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 11:55:40 +02:00

Fix warnings

This commit is contained in:
Anton Leherbauer 2008-04-17 13:43:54 +00:00
parent 70db16224a
commit 93ddce7436
6 changed files with 58 additions and 30 deletions

View file

@ -904,6 +904,7 @@ public final class CIndenter {
int pos= fPosition;
if (!skipScope())
fPosition= pos;
return skipToStatementStart(danglingElse, false);
case Symbols.TokenSEMICOLON:
// this is the 90% case: after a statement block
// the end of the previous statement / block previous.end
@ -992,12 +993,14 @@ public final class CIndenter {
fPosition= offset;
fLine= line;
// else: fall through to default
return skipToPreviousListItemOrListStart();
case Symbols.TokenCOMMA:
// inside a list of some type
// easy if there is already a list item before with its own indentation - we just align
// if not: take the start of the list ( LPAREN, LBRACE, LBRACKET ) and either align or
// indent by list-indent
return skipToPreviousListItemOrListStart();
default:
// inside whatever we don't know about: similar to the list case:
// if we are inside a continued expression, then either align with a previous line that has indentation
@ -1207,6 +1210,11 @@ public final class CIndenter {
if (isInBlock)
mayBeMethodBody= READ_PARENS;
// fall thru
pos= fPreviousPos;
if (skipScope())
break;
else
return pos;
case Symbols.TokenRBRACKET:
case Symbols.TokenGREATERTHAN:
pos= fPreviousPos;
@ -1284,6 +1292,7 @@ public final class CIndenter {
return false;
}
// fall thru
continue;
case Symbols.TokenDOUBLECOLON:
case Symbols.TokenOTHER:
continue;
@ -1495,10 +1504,14 @@ public final class CIndenter {
if (!isGenericStarter(getTokenContent()))
break;
// fall thru
if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
return true;
break;
case Symbols.TokenQUESTIONMARK:
case Symbols.TokenGREATERTHAN:
if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
return true;
break;
}
// <> are harder to detect - restore the position if we fail
fPosition= storedPosition;
@ -1765,6 +1778,8 @@ public final class CIndenter {
switch (fToken) {
case Symbols.TokenRBRACE:
skipScope(); // and fall thru
skipToStatementStart(false, false);
return fToken == Symbols.TokenDO;
case Symbols.TokenSEMICOLON:
skipToStatementStart(false, false);
return fToken == Symbols.TokenDO;

View file

@ -214,6 +214,8 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
if (fLast != BACKSLASH && fLast != BACKSLASH_CR && fLast != BACKSLASH_BACKSLASH) {
return postFix(fState);
}
consume();
continue;
default:
consume();
@ -371,6 +373,8 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
}
}
// fallthrough
consume();
break;
default:
consume();
break;
@ -410,6 +414,8 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
break;
}
}
consume();
break;
case '"':
if (fLast != BACKSLASH) {

View file

@ -247,7 +247,8 @@ public final class AsmPartitionScanner implements IPartitionTokenScanner, ICPart
if (fLast != BACKSLASH && fLast != BACKSLASH_CR && fLast != BACKSLASH_BACKSLASH) {
return postFix(fState);
}
consume();
continue;
default:
consume();
continue;
@ -431,7 +432,8 @@ public final class AsmPartitionScanner implements IPartitionTokenScanner, ICPart
break;
}
}
// fallthrough
consume();
break;
default:
consume();
break;

View file

@ -88,6 +88,7 @@ public class BestMatchHover extends AbstractCEditorTextHover {
/*
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
*/
@SuppressWarnings("deprecation")
@Override
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
@ -113,6 +114,7 @@ public class BestMatchHover extends AbstractCEditorTextHover {
/*
* @see org.eclipse.jface.text.ITextHoverExtension2#getHoverInfo2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
*/
@SuppressWarnings("deprecation")
@Override
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {

View file

@ -64,6 +64,7 @@ public class CEditorTextHoverProxy extends AbstractCEditorTextHover {
/*
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
*/
@SuppressWarnings("deprecation")
@Override
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
if (ensureHoverCreated())
@ -77,6 +78,7 @@ public class CEditorTextHoverProxy extends AbstractCEditorTextHover {
* @see org.eclipse.jface.text.ITextHoverExtension2#getHoverInfo2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
* @since 5.0
*/
@SuppressWarnings("deprecation")
@Override
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
if (ensureHoverCreated()) {

View file

@ -104,6 +104,7 @@ public class CInformationProvider implements IInformationProvider, IInformationP
/*
* @see IInformationProvider#getInformation(ITextViewer, IRegion)
*/
@SuppressWarnings("deprecation")
public String getInformation(ITextViewer textViewer, IRegion subject) {
if (fImplementation != null) {
String s= fImplementation.getHoverInfo(textViewer, subject);