mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
Fix compilation with Neon M4.
Change-Id: Ia7f862540b14a2eec37804049d4cfb27e9f028e0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
871e7abcd0
commit
af49d7701a
4 changed files with 41 additions and 40 deletions
|
@ -65,8 +65,7 @@ public class CFormattingStrategy extends ContextBasedFormattingStrategy {
|
|||
if (document == null || partition == null)
|
||||
return;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> preferences = getPreferences();
|
||||
Map<String, String> preferences = getPreferences();
|
||||
|
||||
try {
|
||||
TextEdit edit = CodeFormatterUtil.format(
|
||||
|
|
|
@ -2184,12 +2184,11 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
}
|
||||
int offset= lineRegion.getOffset();
|
||||
int length= lineRegion.getLength();
|
||||
@SuppressWarnings("unchecked")
|
||||
Iterator<SimpleMarkerAnnotation> it= bpModel.getAnnotationIterator(offset, length, true, true);
|
||||
Iterator<Annotation> it= bpModel.getAnnotationIterator(offset, length, true, true);
|
||||
List<IBreakpoint> bpList= new ArrayList<IBreakpoint>(5);
|
||||
final IBreakpointManager bpMgr= DebugPlugin.getDefault().getBreakpointManager();
|
||||
while (it.hasNext()) {
|
||||
final SimpleMarkerAnnotation annotation= it.next();
|
||||
final SimpleMarkerAnnotation annotation= (SimpleMarkerAnnotation) it.next();
|
||||
IBreakpoint bp= bpMgr.getBreakpoint(annotation.getMarker());
|
||||
if (bp != null) {
|
||||
bpList.add(bp);
|
||||
|
|
|
@ -128,10 +128,9 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Annotation findAnnotation(IMarker marker) {
|
||||
for (Iterator<SimpleMarkerAnnotation> it= getAnnotationIterator(false); it.hasNext();) {
|
||||
SimpleMarkerAnnotation a= it.next();
|
||||
for (Iterator<Annotation> it= getAnnotationIterator(false); it.hasNext();) {
|
||||
SimpleMarkerAnnotation a= (SimpleMarkerAnnotation) it.next();
|
||||
if (a.getMarker().equals(marker)) {
|
||||
return a;
|
||||
}
|
||||
|
|
|
@ -188,8 +188,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
}
|
||||
|
||||
public Iterator<Position> getPositionIterator(String category, int offset) throws BadPositionCategoryException {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Position> positions = (List<Position>) getDocumentManagedPositions().get(category);
|
||||
List<Position> positions = getDocumentManagedPositions().get(category);
|
||||
if (positions == null) {
|
||||
throw new BadPositionCategoryException();
|
||||
}
|
||||
|
@ -198,22 +197,38 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
}
|
||||
|
||||
public Iterator<AddressRangePosition> getPositionIterator(String category, BigInteger address) throws BadPositionCategoryException {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<AddressRangePosition> positions = (List<AddressRangePosition>) getDocumentManagedPositions().get(category);
|
||||
if (positions == null) {
|
||||
throw new BadPositionCategoryException();
|
||||
}
|
||||
List<AddressRangePosition> positions = getAddressRangePositions(category);
|
||||
int idx = computeIndexInPositionListFirst(positions, address);
|
||||
return positions.listIterator(idx);
|
||||
}
|
||||
|
||||
public int computeIndexInCategory(String category, BigInteger address) throws BadPositionCategoryException {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<AddressRangePosition> c = (List<AddressRangePosition>) getDocumentManagedPositions().get(category);
|
||||
if (c == null) {
|
||||
private List<AddressRangePosition> getAddressRangePositions(String category) throws BadPositionCategoryException {
|
||||
List<Position> tmpPositions = getDocumentManagedPositions().get(category);
|
||||
if (tmpPositions == null) {
|
||||
throw new BadPositionCategoryException();
|
||||
}
|
||||
return computeIndexInPositionListFirst(c, address);
|
||||
List<AddressRangePosition> positions = new ArrayList<>();
|
||||
for(Position position: tmpPositions) {
|
||||
positions.add((AddressRangePosition) position);
|
||||
}
|
||||
return positions;
|
||||
}
|
||||
|
||||
private List<AddressRangePosition> getAddressRangePositionsRaw(String category) {
|
||||
List<Position> tmpPositions = getDocumentManagedPositions().get(category);
|
||||
if (tmpPositions == null) {
|
||||
return null;
|
||||
}
|
||||
List<AddressRangePosition> positions = new ArrayList<>();
|
||||
for(Position position: tmpPositions) {
|
||||
positions.add((AddressRangePosition) position);
|
||||
}
|
||||
return positions;
|
||||
}
|
||||
|
||||
public int computeIndexInCategory(String category, BigInteger address) throws BadPositionCategoryException {
|
||||
List<AddressRangePosition> positions = getAddressRangePositions(category);
|
||||
return computeIndexInPositionListFirst(positions, address);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -380,8 +395,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
*/
|
||||
public Position getPositionOfIndex(String category, int index) throws BadPositionCategoryException {
|
||||
if (index >= 0) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Position> positions = (List<Position>) getDocumentManagedPositions().get(category);
|
||||
List<Position> positions = getDocumentManagedPositions().get(category);
|
||||
if (positions == null) {
|
||||
throw new BadPositionCategoryException();
|
||||
}
|
||||
|
@ -398,8 +412,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
}
|
||||
|
||||
public AddressRangePosition getPositionOfAddress(String category, BigInteger address) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<AddressRangePosition> positions = (List<AddressRangePosition>) getDocumentManagedPositions().get(category);
|
||||
List<AddressRangePosition> positions = getAddressRangePositionsRaw(category);
|
||||
if (positions == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -419,8 +432,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
* @return
|
||||
*/
|
||||
public AddressRangePosition getPositionInAddressRange(String category, AddressRangePosition range) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<AddressRangePosition> positions = (List<AddressRangePosition>) getDocumentManagedPositions().get(category);
|
||||
List<AddressRangePosition> positions = getAddressRangePositionsRaw(category);
|
||||
if (positions == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -643,8 +655,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
* @throws BadLocationException
|
||||
*/
|
||||
public Position getPosition(String category, int offset, boolean allowZeroLength) throws BadLocationException, BadPositionCategoryException {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Position> list = (List<Position>) getDocumentManagedPositions().get(category);
|
||||
List<Position> list = getDocumentManagedPositions().get(category);
|
||||
int idx;
|
||||
idx = computeIndexInPositionList(list, offset, true);
|
||||
if (idx > 0) {
|
||||
|
@ -681,8 +692,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
* @param pos
|
||||
*/
|
||||
public void addModelPositionFirst(AddressRangePosition pos) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<AddressRangePosition> list = (List<AddressRangePosition>) getDocumentManagedPositions().get(CATEGORY_MODEL);
|
||||
List<AddressRangePosition> list = getAddressRangePositionsRaw(CATEGORY_MODEL);
|
||||
int idx;
|
||||
idx = computeIndexInPositionListFirst(list, pos.fAddressOffset.add(pos.fAddressLength));
|
||||
if (idx < list.size()) {
|
||||
|
@ -724,11 +734,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
* @throws BadPositionCategoryException
|
||||
*/
|
||||
public void addPositionLast(String category, AddressRangePosition pos) throws BadPositionCategoryException {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<AddressRangePosition> list = (List<AddressRangePosition>) getDocumentManagedPositions().get(category);
|
||||
if (list == null) {
|
||||
throw new BadPositionCategoryException();
|
||||
}
|
||||
List<AddressRangePosition> list = getAddressRangePositions(category);
|
||||
if (DEBUG) System.out.println("Adding position to category <" + category + "> : " + pos); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
list.add(computeIndexInPositionListLast(list, pos.fAddressOffset), pos);
|
||||
}
|
||||
|
@ -817,7 +823,6 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removePositions(String category, List<AddressRangePosition> toRemove) {
|
||||
if (toRemove.isEmpty()) {
|
||||
return;
|
||||
|
@ -831,12 +836,12 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
}
|
||||
}
|
||||
|
||||
List<Position> positions = (List<Position>) getDocumentManagedPositions().get(category);
|
||||
List<Position> positions = getDocumentManagedPositions().get(category);
|
||||
if (positions != null) {
|
||||
positions.removeAll(toRemove);
|
||||
}
|
||||
if (!category.equals(CATEGORY_MODEL)) {
|
||||
positions = (List<Position>) getDocumentManagedPositions().get(CATEGORY_MODEL);
|
||||
positions = getDocumentManagedPositions().get(CATEGORY_MODEL);
|
||||
if (positions != null) {
|
||||
positions.removeAll(toRemove);
|
||||
}
|
||||
|
@ -852,8 +857,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
|
|||
if (category == null)
|
||||
throw new BadPositionCategoryException();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Position> list = (List<Position>) getDocumentManagedPositions().get(category);
|
||||
List<Position> list = getDocumentManagedPositions().get(category);
|
||||
if (list == null)
|
||||
throw new BadPositionCategoryException();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue