Skip to content

Commit

Permalink
formating
Browse files Browse the repository at this point in the history
  • Loading branch information
darlentar committed Dec 20, 2022
1 parent 3065711 commit 4a6fc37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
8 changes: 0 additions & 8 deletions demos/helloworld/.gitignore

This file was deleted.

12 changes: 6 additions & 6 deletions lib/stubs/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ extern "C" {
CAMLlocal1(_var);

if (!var.isValid()) {
_dest =caml_hash_variant("empty");
_dest = caml_hash_variant("empty");
} else {
const int ut = var.userType();

switch (ut) {
case QMetaType::Bool:
_dest = caml_alloc(2, 0);
Store_field(_dest, 0,caml_hash_variant("bool"));
Store_field(_dest, 0, caml_hash_variant("bool"));
Store_field(_dest, 1, Val_bool(var.toBool()));
break;
case QMetaType::QString:
_dest = caml_alloc(2, 0);
Store_field(_dest, 0,caml_hash_variant("string"));
Store_field(_dest, 0, caml_hash_variant("string"));
Store_field(_dest, 1, caml_copy_string(var.value<QString>().toLocal8Bit().data()));
break;
case QMetaType::Int:
_dest = caml_alloc(2, 0);
Store_field(_dest, 0,caml_hash_variant("int"));
Store_field(_dest, 0, caml_hash_variant("int"));
Store_field(_dest, 1, Val_int(var.value<int>()));
break;
case QMetaType::Float:
case QMetaType::Double:
_dest = caml_alloc(2, 0);
Store_field(_dest, 0,caml_hash_variant("float"));
Store_field(_dest, 0, caml_hash_variant("float"));
Store_field(_dest, 1, caml_copy_double(var.toFloat()));
break;
case QMetaType::User:
Expand All @@ -67,7 +67,7 @@ extern "C" {
_var = caml_alloc_small(1,Abstract_tag);
(*((QObject **) &Field(_var, 0))) = vvv;
_dest = caml_alloc(2,0);
Store_field(_dest, 0,caml_hash_variant("qobject"));
Store_field(_dest, 0, caml_hash_variant("qobject"));
Store_field(_dest, 1, _var);
}
break;
Expand Down
2 changes: 0 additions & 2 deletions ppx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ watch:

ppx_qt: ppx_qt.native
ln -sf ./ppx_qt.native ./ppx_qt


0 comments on commit 4a6fc37

Please sign in to comment.