Commit a19d860b authored by osku's avatar osku

pars_set_dfield_type():

 Remove never-reached duplicate code.

 Replace "if (!cond) ut_error" with "ut_a(cond)".
parent 90969c94
...@@ -1122,47 +1122,25 @@ pars_set_dfield_type( ...@@ -1122,47 +1122,25 @@ pars_set_dfield_type(
} }
if (type == &pars_int_token) { if (type == &pars_int_token) {
if (len != 0) { ut_a(len == 0);
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_INT, flags, 4, 0); dtype_set(dfield_get_type(dfield), DATA_INT, flags, 4, 0);
} else if (type == &pars_char_token) { } else if (type == &pars_char_token) {
if (len != 0) { ut_a(len == 0);
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_VARCHAR, dtype_set(dfield_get_type(dfield), DATA_VARCHAR,
DATA_ENGLISH | flags, 0, 0); DATA_ENGLISH | flags, 0, 0);
} else if (type == &pars_binary_token) { } else if (type == &pars_binary_token) {
if (len == 0) { ut_a(len != 0);
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_FIXBINARY, dtype_set(dfield_get_type(dfield), DATA_FIXBINARY,
DATA_BINARY_TYPE | flags, len, 0); DATA_BINARY_TYPE | flags, len, 0);
} else if (type == &pars_blob_token) { } else if (type == &pars_blob_token) {
if (len != 0) { ut_a(len == 0);
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_BLOB, dtype_set(dfield_get_type(dfield), DATA_BLOB,
DATA_BINARY_TYPE | flags, 0, 0); DATA_BINARY_TYPE | flags, 0, 0);
} else if (type == &pars_binary_token) {
if (len == 0) {
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_FIXBINARY,
DATA_BINARY_TYPE, len, 0);
} else if (type == &pars_blob_token) {
if (len != 0) {
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_BLOB,
DATA_BINARY_TYPE, 0, 0);
} else { } else {
ut_error; ut_error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment