mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Fix warnings
This commit is contained in:
parent
70db16224a
commit
93ddce7436
6 changed files with 58 additions and 30 deletions
|
@ -904,6 +904,7 @@ public final class CIndenter {
|
||||||
int pos= fPosition;
|
int pos= fPosition;
|
||||||
if (!skipScope())
|
if (!skipScope())
|
||||||
fPosition= pos;
|
fPosition= pos;
|
||||||
|
return skipToStatementStart(danglingElse, false);
|
||||||
case Symbols.TokenSEMICOLON:
|
case Symbols.TokenSEMICOLON:
|
||||||
// this is the 90% case: after a statement block
|
// this is the 90% case: after a statement block
|
||||||
// the end of the previous statement / block previous.end
|
// the end of the previous statement / block previous.end
|
||||||
|
@ -992,12 +993,14 @@ public final class CIndenter {
|
||||||
fPosition= offset;
|
fPosition= offset;
|
||||||
fLine= line;
|
fLine= line;
|
||||||
// else: fall through to default
|
// else: fall through to default
|
||||||
|
return skipToPreviousListItemOrListStart();
|
||||||
|
|
||||||
case Symbols.TokenCOMMA:
|
case Symbols.TokenCOMMA:
|
||||||
// inside a list of some type
|
// inside a list of some type
|
||||||
// easy if there is already a list item before with its own indentation - we just align
|
// 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
|
// if not: take the start of the list ( LPAREN, LBRACE, LBRACKET ) and either align or
|
||||||
// indent by list-indent
|
// indent by list-indent
|
||||||
|
return skipToPreviousListItemOrListStart();
|
||||||
default:
|
default:
|
||||||
// inside whatever we don't know about: similar to the list case:
|
// 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
|
// 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)
|
if (isInBlock)
|
||||||
mayBeMethodBody= READ_PARENS;
|
mayBeMethodBody= READ_PARENS;
|
||||||
// fall thru
|
// fall thru
|
||||||
|
pos= fPreviousPos;
|
||||||
|
if (skipScope())
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
return pos;
|
||||||
case Symbols.TokenRBRACKET:
|
case Symbols.TokenRBRACKET:
|
||||||
case Symbols.TokenGREATERTHAN:
|
case Symbols.TokenGREATERTHAN:
|
||||||
pos= fPreviousPos;
|
pos= fPreviousPos;
|
||||||
|
@ -1284,6 +1292,7 @@ public final class CIndenter {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// fall thru
|
// fall thru
|
||||||
|
continue;
|
||||||
case Symbols.TokenDOUBLECOLON:
|
case Symbols.TokenDOUBLECOLON:
|
||||||
case Symbols.TokenOTHER:
|
case Symbols.TokenOTHER:
|
||||||
continue;
|
continue;
|
||||||
|
@ -1495,10 +1504,14 @@ public final class CIndenter {
|
||||||
if (!isGenericStarter(getTokenContent()))
|
if (!isGenericStarter(getTokenContent()))
|
||||||
break;
|
break;
|
||||||
// fall thru
|
// fall thru
|
||||||
|
if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
case Symbols.TokenQUESTIONMARK:
|
case Symbols.TokenQUESTIONMARK:
|
||||||
case Symbols.TokenGREATERTHAN:
|
case Symbols.TokenGREATERTHAN:
|
||||||
if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
|
if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
|
||||||
return true;
|
return true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// <> are harder to detect - restore the position if we fail
|
// <> are harder to detect - restore the position if we fail
|
||||||
fPosition= storedPosition;
|
fPosition= storedPosition;
|
||||||
|
@ -1765,6 +1778,8 @@ public final class CIndenter {
|
||||||
switch (fToken) {
|
switch (fToken) {
|
||||||
case Symbols.TokenRBRACE:
|
case Symbols.TokenRBRACE:
|
||||||
skipScope(); // and fall thru
|
skipScope(); // and fall thru
|
||||||
|
skipToStatementStart(false, false);
|
||||||
|
return fToken == Symbols.TokenDO;
|
||||||
case Symbols.TokenSEMICOLON:
|
case Symbols.TokenSEMICOLON:
|
||||||
skipToStatementStart(false, false);
|
skipToStatementStart(false, false);
|
||||||
return fToken == Symbols.TokenDO;
|
return fToken == Symbols.TokenDO;
|
||||||
|
|
|
@ -214,6 +214,8 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
|
||||||
if (fLast != BACKSLASH && fLast != BACKSLASH_CR && fLast != BACKSLASH_BACKSLASH) {
|
if (fLast != BACKSLASH && fLast != BACKSLASH_CR && fLast != BACKSLASH_BACKSLASH) {
|
||||||
return postFix(fState);
|
return postFix(fState);
|
||||||
}
|
}
|
||||||
|
consume();
|
||||||
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
consume();
|
consume();
|
||||||
|
@ -371,6 +373,8 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
|
consume();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
consume();
|
consume();
|
||||||
break;
|
break;
|
||||||
|
@ -410,6 +414,8 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
consume();
|
||||||
|
break;
|
||||||
|
|
||||||
case '"':
|
case '"':
|
||||||
if (fLast != BACKSLASH) {
|
if (fLast != BACKSLASH) {
|
||||||
|
|
|
@ -247,7 +247,8 @@ public final class AsmPartitionScanner implements IPartitionTokenScanner, ICPart
|
||||||
if (fLast != BACKSLASH && fLast != BACKSLASH_CR && fLast != BACKSLASH_BACKSLASH) {
|
if (fLast != BACKSLASH && fLast != BACKSLASH_CR && fLast != BACKSLASH_BACKSLASH) {
|
||||||
return postFix(fState);
|
return postFix(fState);
|
||||||
}
|
}
|
||||||
|
consume();
|
||||||
|
continue;
|
||||||
default:
|
default:
|
||||||
consume();
|
consume();
|
||||||
continue;
|
continue;
|
||||||
|
@ -431,7 +432,8 @@ public final class AsmPartitionScanner implements IPartitionTokenScanner, ICPart
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fallthrough
|
consume();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
consume();
|
consume();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -88,6 +88,7 @@ public class BestMatchHover extends AbstractCEditorTextHover {
|
||||||
/*
|
/*
|
||||||
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
|
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
|
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)
|
* @see org.eclipse.jface.text.ITextHoverExtension2#getHoverInfo2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
|
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class CEditorTextHoverProxy extends AbstractCEditorTextHover {
|
||||||
/*
|
/*
|
||||||
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
|
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
|
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
|
||||||
if (ensureHoverCreated())
|
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)
|
* @see org.eclipse.jface.text.ITextHoverExtension2#getHoverInfo2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
|
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
|
||||||
if (ensureHoverCreated()) {
|
if (ensureHoverCreated()) {
|
||||||
|
|
|
@ -104,6 +104,7 @@ public class CInformationProvider implements IInformationProvider, IInformationP
|
||||||
/*
|
/*
|
||||||
* @see IInformationProvider#getInformation(ITextViewer, IRegion)
|
* @see IInformationProvider#getInformation(ITextViewer, IRegion)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public String getInformation(ITextViewer textViewer, IRegion subject) {
|
public String getInformation(ITextViewer textViewer, IRegion subject) {
|
||||||
if (fImplementation != null) {
|
if (fImplementation != null) {
|
||||||
String s= fImplementation.getHoverInfo(textViewer, subject);
|
String s= fImplementation.getHoverInfo(textViewer, subject);
|
||||||
|
|
Loading…
Add table
Reference in a new issue