AC_Fence: create and use INTERNAL_ERROR macro so we get line numbers

This commit is contained in:
Peter Barker 2020-04-30 10:40:45 +10:00 committed by Peter Barker
parent 75b5e20c6a
commit 069bd04bdc

View File

@ -59,7 +59,7 @@ bool AC_PolyFence_loader::find_storage_offset_for_seq(const uint16_t seq, uint16
}
if (entry == nullptr) {
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return false;
}
@ -72,7 +72,7 @@ bool AC_PolyFence_loader::find_storage_offset_for_seq(const uint16_t seq, uint16
case AC_PolyFenceType::CIRCLE_INCLUSION:
case AC_PolyFenceType::CIRCLE_EXCLUSION:
if (delta != 0) {
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return false;
}
break;
@ -84,12 +84,12 @@ bool AC_PolyFence_loader::find_storage_offset_for_seq(const uint16_t seq, uint16
break;
case AC_PolyFenceType::RETURN_POINT:
if (delta != 0) {
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return false;
}
break;
case AC_PolyFenceType::END_OF_STORAGE:
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return false;
}
return true;
@ -133,7 +133,7 @@ bool AC_PolyFence_loader::get_item(const uint16_t seq, AC_PolyFenceItem &item)
break;
case AC_PolyFenceType::END_OF_STORAGE:
// read end-of-storage when I should never do so
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return false;
}
return true;
@ -433,7 +433,7 @@ void AC_PolyFence_loader::scan_eeprom_count_fences(const AC_PolyFenceType type,
_eeprom_fence_count++;
switch (type) {
case AC_PolyFenceType::END_OF_STORAGE:
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
break;
case AC_PolyFenceType::POLYGON_EXCLUSION:
case AC_PolyFenceType::POLYGON_INCLUSION: {
@ -460,7 +460,7 @@ bool AC_PolyFence_loader::count_eeprom_fences()
void AC_PolyFence_loader::scan_eeprom_index_fences(const AC_PolyFenceType type, uint16_t read_offset)
{
if (_index == nullptr) {
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return;
}
if (type == AC_PolyFenceType::END_OF_STORAGE) {
@ -471,7 +471,7 @@ void AC_PolyFence_loader::scan_eeprom_index_fences(const AC_PolyFenceType type,
index.storage_offset = read_offset;
switch (type) {
case AC_PolyFenceType::END_OF_STORAGE:
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
break;
case AC_PolyFenceType::POLYGON_EXCLUSION:
case AC_PolyFenceType::POLYGON_INCLUSION: {
@ -595,7 +595,7 @@ uint16_t AC_PolyFence_loader::sum_of_polygon_point_counts_and_returnpoint()
ret += index.count;
break;
case AC_PolyFenceType::END_OF_STORAGE:
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
break;
}
}
@ -966,7 +966,7 @@ uint16_t AC_PolyFence_loader::fence_storage_space_required(const AC_PolyFenceIte
i += new_items[i].vertex_count - 1; // i is incremented down below
break;
case AC_PolyFenceType::END_OF_STORAGE:
AP::internalerror().error(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
break;
case AC_PolyFenceType::CIRCLE_INCLUSION:
case AC_PolyFenceType::CIRCLE_EXCLUSION: