mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
Convert some uses of xassert(false) to BUG("some error message")
This commit is contained in:
parent
e19db15104
commit
1ec5684438
5 changed files with 10 additions and 12 deletions
2
config.c
2
config.c
|
|
@ -1230,7 +1230,7 @@ argv_compare(char *const *argv1, char *const *argv2)
|
|||
return ret;
|
||||
}
|
||||
|
||||
xassert(false);
|
||||
BUG("unexpected loop break");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
2
fdm.c
2
fdm.c
|
|
@ -251,7 +251,7 @@ hook_priority_to_list(struct fdm *fdm, enum fdm_hook_priority priority)
|
|||
case FDM_HOOK_PRIORITY_HIGH: return &fdm->hooks_high;
|
||||
}
|
||||
|
||||
xassert(false);
|
||||
BUG("unhandled priority type");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
2
input.c
2
input.c
|
|
@ -209,7 +209,7 @@ execute_binding(struct seat *seat, struct terminal *term,
|
|||
break;
|
||||
|
||||
default:
|
||||
xassert(false);
|
||||
BUG("Unhandled action type");
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
5
render.c
5
render.c
|
|
@ -1367,11 +1367,10 @@ get_csd_data(const struct terminal *term, enum csd_surface surf_idx)
|
|||
case CSD_SURF_CLOSE: return (struct csd_data){term->width - 1 * button_width, 0, button_close_width, title_height};
|
||||
|
||||
case CSD_SURF_COUNT:
|
||||
xassert(false);
|
||||
return (struct csd_data){0};
|
||||
break;
|
||||
}
|
||||
|
||||
xassert(false);
|
||||
BUG("Invalid csd_surface type");
|
||||
return (struct csd_data){0};
|
||||
}
|
||||
|
||||
|
|
|
|||
11
terminal.c
11
terminal.c
|
|
@ -97,8 +97,7 @@ data_to_slave(struct terminal *term, const void *data, size_t len,
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Shouldn't get here */
|
||||
xassert(false);
|
||||
BUG("Unexpected async_write() return value");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1931,7 +1930,7 @@ term_row_rel_to_abs(const struct terminal *term, int row)
|
|||
return min(row + term->scroll_region.start, term->scroll_region.end - 1);
|
||||
}
|
||||
|
||||
xassert(false);
|
||||
BUG("Invalid cursor_origin value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -2483,7 +2482,7 @@ term_mouse_down(struct terminal *term, int button, int row, int col,
|
|||
|
||||
case MOUSE_X10:
|
||||
/* Never enabled */
|
||||
xassert(false && "unimplemented");
|
||||
BUG("X10 mouse mode not implemented");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2525,7 +2524,7 @@ term_mouse_up(struct terminal *term, int button, int row, int col,
|
|||
|
||||
case MOUSE_X10:
|
||||
/* Never enabled */
|
||||
xassert(false && "unimplemented");
|
||||
BUG("X10 mouse mode not implemented");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2572,7 +2571,7 @@ term_mouse_motion(struct terminal *term, int button, int row, int col,
|
|||
|
||||
case MOUSE_X10:
|
||||
/* Never enabled */
|
||||
xassert(false && "unimplemented");
|
||||
BUG("X10 mouse mode not implemented");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue