mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-27 03:51:22 -03:00
Eliminate the CHECK() macro
This thing was pretty useless.
This commit is contained in:
@@ -112,7 +112,7 @@ static int parse_util_locate_brackets_of_type(const wchar_t *in, wchar_t **begin
|
||||
|
||||
wchar_t *paran_begin = 0, *paran_end = 0;
|
||||
|
||||
CHECK(in, 0);
|
||||
assert(in && "null parameter");
|
||||
|
||||
for (pos = const_cast<wchar_t *>(in); *pos; pos++) {
|
||||
if (prev != '\\') {
|
||||
@@ -236,10 +236,9 @@ int parse_util_locate_cmdsubst_range(const wcstring &str, size_t *inout_cursor_o
|
||||
|
||||
void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wchar_t **a,
|
||||
const wchar_t **b) {
|
||||
assert(buff && "Null buffer");
|
||||
const wchar_t *const cursor = buff + cursor_pos;
|
||||
|
||||
CHECK(buff, );
|
||||
|
||||
const size_t bufflen = std::wcslen(buff);
|
||||
assert(cursor_pos <= bufflen);
|
||||
|
||||
@@ -285,12 +284,11 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
|
||||
/// Get the beginning and end of the job or process definition under the cursor.
|
||||
static void job_or_process_extent(const wchar_t *buff, size_t cursor_pos, const wchar_t **a,
|
||||
const wchar_t **b, int process) {
|
||||
assert(buff && "Null buffer");
|
||||
const wchar_t *begin, *end;
|
||||
wchar_t *buffcpy;
|
||||
int finished = 0;
|
||||
|
||||
CHECK(buff, );
|
||||
|
||||
if (a) *a = 0;
|
||||
if (b) *b = 0;
|
||||
parse_util_cmdsubst_extent(buff, cursor_pos, &begin, &end);
|
||||
@@ -349,10 +347,9 @@ void parse_util_job_extent(const wchar_t *buff, size_t pos, const wchar_t **a, c
|
||||
void parse_util_token_extent(const wchar_t *buff, size_t cursor_pos, const wchar_t **tok_begin,
|
||||
const wchar_t **tok_end, const wchar_t **prev_begin,
|
||||
const wchar_t **prev_end) {
|
||||
assert(buff && "Null buffer");
|
||||
const wchar_t *a = NULL, *b = NULL, *pa = NULL, *pb = NULL;
|
||||
|
||||
CHECK(buff, );
|
||||
|
||||
const wchar_t *cmdsubst_begin, *cmdsubst_end;
|
||||
parse_util_cmdsubst_extent(buff, cursor_pos, &cmdsubst_begin, &cmdsubst_end);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user