diff --git a/.envrc b/.envrc deleted file mode 100644 index 8392d15..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 33f464a..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Nix -result* - -# Misc -.direnv - -# CMake -build/ -.cache/ - diff --git a/example/main.c b/example/main.c index 63e8405..df00a49 100644 --- a/example/main.c +++ b/example/main.c @@ -7,30 +7,30 @@ static struct Object* static_method(struct Object* self); static struct Object* instance_method(struct Object* self); -struct Method Test_meta_methods[] = { - { .sel = "staticMethod", .impl = static_method }, -}; -struct Class TestMetaClass = { - .class = &TestMetaClass, - .name = "Test(meta)", - .super = &MObjectMetaClass, - .methods = Test_meta_methods, - .methods_count = sizeof(Test_meta_methods) / sizeof(struct Method), -}; - -struct Method Test_methods[] = { - { .sel = "instanceMethod", .impl = instance_method }, -}; -struct Class Test = { - .class = &TestMetaClass, - .name = "Test", - .super = &MObject, - .methods = Test_methods, - .methods_count = sizeof(Test_methods) / sizeof(struct Method), -}; - int main() { + struct Method Test_meta_methods[] = { + { .sel = "staticMethod", .impl = static_method }, + }; + struct Class TestMetaClass = { + .class = &TestMetaClass, + .name = "Test(meta)", + .super = &MObjectMetaClass, + .methods = Test_meta_methods, + .methods_count = sizeof(Test_meta_methods) / sizeof(struct Method), + }; + + struct Method Test_methods[] = { + { .sel = "instanceMethod", .impl = instance_method }, + }; + struct Class Test = { + .class = &TestMetaClass, + .name = "Test", + .super = &MObject, + .methods = Test_methods, + .methods_count = sizeof(Test_methods) / sizeof(struct Method), + }; + msg_send((struct Object*)&Test, "staticMethod"); struct Object* obj = msg_send((struct Object*)&Test, "alloc");