mirror of
https://gitlab.com/eql/lqml.git
synced 2026-01-25 14:00:36 -08:00
formatting
This commit is contained in:
parent
4346c0c5f5
commit
79a5e5cc30
5 changed files with 33 additions and 61 deletions
|
|
@ -82,8 +82,7 @@ void error_msg(const char* fun, cl_object l_args) {
|
|||
STRING("~%[LQML:error] ~A ~{~S~^ ~}~%"),
|
||||
STRING(fun),
|
||||
l_args);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
STATIC_SYMBOL (s_error_output, "*ERROR-OUTPUT*")
|
||||
cl_format(4,
|
||||
cl_symbol_value(s_error_output),
|
||||
|
|
@ -143,8 +142,7 @@ cl_object qset2(cl_object l_obj, cl_object l_args) {
|
|||
QVariant var;
|
||||
if (mp.isEnumType()) {
|
||||
var = toInt(l_val);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
#if QT_VERSION < 0x060000
|
||||
var = toQVariant(l_val, mp.type());
|
||||
#else
|
||||
|
|
@ -294,8 +292,7 @@ cl_object qtranslate(cl_object l_con, cl_object l_src, cl_object l_n) {
|
|||
cl_object l_ret;
|
||||
if (n == -1) {
|
||||
l_ret = from_qstring(QCoreApplication::translate(context, source));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
l_ret = from_qstring(QCoreApplication::translate(context, source, 0, n));
|
||||
}
|
||||
ecl_return1(ecl_process_env(), l_ret);
|
||||
|
|
@ -389,8 +386,7 @@ cl_object qrun_on_ui_thread2(cl_object l_function_or_closure, cl_object l_blocki
|
|||
// direct call
|
||||
LQML::me->runOnUiThread(l_function_or_closure);
|
||||
return ECL_T;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// queued call in main event loop (GUI thread)
|
||||
QMetaObject::invokeMethod(LQML::me,
|
||||
"runOnUiThread",
|
||||
|
|
|
|||
|
|
@ -117,8 +117,7 @@ T toFloat(cl_object l_num) {
|
|||
T f = 0;
|
||||
if (ECL_SINGLE_FLOAT_P(l_num)) {
|
||||
f = sf(l_num);
|
||||
}
|
||||
else if (ECL_DOUBLE_FLOAT_P(l_num)) {
|
||||
} else if (ECL_DOUBLE_FLOAT_P(l_num)) {
|
||||
f = df(l_num);
|
||||
}
|
||||
#ifdef ECL_LONG_FLOAT
|
||||
|
|
@ -128,13 +127,11 @@ T toFloat(cl_object l_num) {
|
|||
#endif
|
||||
else if (cl_integerp(l_num) == ECL_T) {
|
||||
f = fixint(l_num);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
cl_object l_f = cl_float(1, l_num);
|
||||
if (ECL_DOUBLE_FLOAT_P(l_f)) {
|
||||
f = df(l_f);
|
||||
}
|
||||
else if (ECL_SINGLE_FLOAT_P(l_f)) {
|
||||
} else if (ECL_SINGLE_FLOAT_P(l_f)) {
|
||||
f = sf(l_f);
|
||||
}
|
||||
#ifdef ECL_LONG_FLOAT
|
||||
|
|
@ -160,8 +157,7 @@ QByteArray toCString(cl_object l_str) {
|
|||
if (ECL_BASE_STRING_P(l_str)) {
|
||||
ba = QByteArray(reinterpret_cast<char*>(l_str->base_string.self),
|
||||
l_str->base_string.fillp);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint l = l_str->string.fillp;
|
||||
ba.resize(l);
|
||||
ecl_character* l_s = l_str->string.self;
|
||||
|
|
@ -179,8 +175,7 @@ QString toQString(cl_object l_str) {
|
|||
if (ECL_BASE_STRING_P(l_str)) {
|
||||
s = QString::fromLatin1(reinterpret_cast<char*>(l_str->base_string.self),
|
||||
l_str->base_string.fillp);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint l = l_str->string.fillp;
|
||||
s.resize(l);
|
||||
ecl_character* l_s = l_str->string.self;
|
||||
|
|
@ -209,25 +204,19 @@ QVariant toQVariant(cl_object l_arg, int type) {
|
|||
default:
|
||||
if (cl_integerp(l_arg) == ECL_T) { // int
|
||||
var = QVariant(toInt(l_arg));
|
||||
}
|
||||
else if (cl_floatp(l_arg) == ECL_T) { // double
|
||||
} else if (cl_floatp(l_arg) == ECL_T) { // double
|
||||
var = QVariant(toFloat<double>(l_arg));
|
||||
}
|
||||
else if (cl_stringp(l_arg) == ECL_T) { // string
|
||||
} else if (cl_stringp(l_arg) == ECL_T) { // string
|
||||
var = QVariant(toQString(l_arg));
|
||||
}
|
||||
else if (l_arg == ECL_T) { // true
|
||||
} else if (l_arg == ECL_T) { // true
|
||||
var = QVariant(true);
|
||||
}
|
||||
else if (l_arg == ECL_NIL) { // false
|
||||
} else if (l_arg == ECL_NIL) { // false
|
||||
var = QVariant(false);
|
||||
}
|
||||
else if (cl_listp(l_arg) == ECL_T) { // list
|
||||
} else if (cl_listp(l_arg) == ECL_T) { // list
|
||||
var = (cl_keywordp(cl_first(l_arg)) == ECL_T)
|
||||
? toQVariantMap(l_arg)
|
||||
: toQVariantList(l_arg);
|
||||
}
|
||||
else { // default: undefined
|
||||
} else { // default: undefined
|
||||
var = QVariant();
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -90,8 +90,7 @@ int main(int argc, char* argv[]) {
|
|||
// load .eclrc
|
||||
if (arguments.contains("-norc")) {
|
||||
arguments.removeAll("-norc");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
#if (defined Q_OS_ANDROID) || (defined Q_OS_IOS)
|
||||
// mobile: don't hang on startup
|
||||
LQML::eval("(x:when-it (probe-file \"~/.eclrc\")"
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ T toFloat(cl_object l_num) {
|
|||
T f = 0;
|
||||
if (ECL_SINGLE_FLOAT_P(l_num)) {
|
||||
f = sf(l_num);
|
||||
}
|
||||
else if (ECL_DOUBLE_FLOAT_P(l_num)) {
|
||||
} else if (ECL_DOUBLE_FLOAT_P(l_num)) {
|
||||
f = df(l_num);
|
||||
}
|
||||
#ifdef ECL_LONG_FLOAT
|
||||
|
|
@ -48,13 +47,11 @@ T toFloat(cl_object l_num) {
|
|||
#endif
|
||||
else if (cl_integerp(l_num) == ECL_T) {
|
||||
f = fixint(l_num);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
cl_object l_f = cl_float(1, l_num);
|
||||
if (ECL_DOUBLE_FLOAT_P(l_f)) {
|
||||
f = df(l_f);
|
||||
}
|
||||
else if (ECL_SINGLE_FLOAT_P(l_f)) {
|
||||
} else if (ECL_SINGLE_FLOAT_P(l_f)) {
|
||||
f = sf(l_f);
|
||||
}
|
||||
#ifdef ECL_LONG_FLOAT
|
||||
|
|
@ -80,8 +77,7 @@ QByteArray toCString(cl_object l_str) {
|
|||
if (ECL_BASE_STRING_P(l_str)) {
|
||||
ba = QByteArray(reinterpret_cast<char*>(l_str->base_string.self),
|
||||
l_str->base_string.fillp);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint l = l_str->string.fillp;
|
||||
ba.resize(l);
|
||||
ecl_character* l_s = l_str->string.self;
|
||||
|
|
@ -111,8 +107,7 @@ QString toQString(cl_object l_str) {
|
|||
if (ECL_BASE_STRING_P(l_str)) {
|
||||
s = QString::fromLatin1(reinterpret_cast<char*>(l_str->base_string.self),
|
||||
l_str->base_string.fillp);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint l = l_str->string.fillp;
|
||||
s.resize(l);
|
||||
ecl_character* l_s = l_str->string.self;
|
||||
|
|
@ -150,28 +145,21 @@ QVariant toQVariant(cl_object l_arg, int type) {
|
|||
default:
|
||||
if (cl_integerp(l_arg) == ECL_T) { // int
|
||||
var = QVariant(toInt(l_arg));
|
||||
}
|
||||
else if (cl_floatp(l_arg) == ECL_T) { // double
|
||||
} else if (cl_floatp(l_arg) == ECL_T) { // double
|
||||
var = QVariant(toFloat<double>(l_arg));
|
||||
}
|
||||
else if (cl_stringp(l_arg) == ECL_T) { // string
|
||||
} else if (cl_stringp(l_arg) == ECL_T) { // string
|
||||
var = QVariant(toQString(l_arg));
|
||||
}
|
||||
else if (l_arg == ECL_T) { // true
|
||||
} else if (l_arg == ECL_T) { // true
|
||||
var = QVariant(true);
|
||||
}
|
||||
else if (l_arg == ECL_NIL) { // false
|
||||
} else if (l_arg == ECL_NIL) { // false
|
||||
var = QVariant(false);
|
||||
}
|
||||
else if (cl_listp(l_arg) == ECL_T) { // list
|
||||
} else if (cl_listp(l_arg) == ECL_T) { // list
|
||||
var = (cl_keywordp(cl_first(l_arg)) == ECL_T)
|
||||
? toQVariantMap(l_arg)
|
||||
: toQVariantList(l_arg);
|
||||
}
|
||||
else if (cl_vectorp(l_arg) == ECL_T) { // vector (of octets)
|
||||
} else if (cl_vectorp(l_arg) == ECL_T) { // vector (of octets)
|
||||
var = QVariant(toQByteArray(l_arg));
|
||||
}
|
||||
else { // default: undefined
|
||||
} else { // default: undefined
|
||||
var = QVariant();
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue