mirror of
https://github.com/sigmasternchen/crap-libs
synced 2025-03-15 07:38:56 +00:00
format change (populate gets class parameter)
This commit is contained in:
parent
b882450ac0
commit
c4ef8a726f
3 changed files with 9 additions and 8 deletions
|
@ -23,8 +23,8 @@ void method(test, destruct)(test_t* this) {
|
|||
this->super.destruct((object_t*) this);
|
||||
}
|
||||
|
||||
void method(test, populate)(test_t* obj) {
|
||||
populate(object)((object_t*) obj, test_class);
|
||||
void method(test, populate)(test_t* obj, class_t c) {
|
||||
populate(object)((object_t*) obj);
|
||||
|
||||
add_method(obj, test, destruct);
|
||||
add_method(obj, test, print);
|
||||
|
@ -32,7 +32,7 @@ void method(test, populate)(test_t* obj) {
|
|||
|
||||
test_t* method(test, construct)(const char* string) {
|
||||
test_t* obj = malloc(sizeof(test_t));
|
||||
populate(test)(obj);
|
||||
populate(test)(obj, test_class);
|
||||
|
||||
obj->string = string;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ const char* method(strbuilder, get)(strbuilder_t* this) {
|
|||
strbuilder_t* method(strbuilder, construct)(const char* string) {
|
||||
strbuilder_t* obj = malloc(sizeof(strbuilder_t));
|
||||
|
||||
populate(strbuilder)(obj);
|
||||
populate(strbuilder)(obj, strbuilder_class);
|
||||
|
||||
obj->string = malloc(strlen(string) + 1);
|
||||
strcpy(obj->string, string);
|
||||
|
@ -64,8 +64,8 @@ strbuilder_t* method(strbuilder, construct)(const char* string) {
|
|||
}
|
||||
|
||||
|
||||
void method(strbuilder, populate)(strbuilder_t* obj) {
|
||||
populate(object)((object_t*) obj, strbuilder_class);
|
||||
void method(strbuilder, populate)(strbuilder_t* obj, class_t c) {
|
||||
populate(object)((object_t*) obj, c);
|
||||
|
||||
obj->string = NULL;
|
||||
obj->strings = NULL;
|
||||
|
|
|
@ -13,10 +13,10 @@ class(exception, exception_class, object_class, true) {
|
|||
void (*destruct)(defclass exception*);
|
||||
} exception_t;
|
||||
|
||||
void method(exception, populate)(exception_t*);
|
||||
void method(exception, populate)(exception_t*, class_t);
|
||||
exception_t* method(exception, construct)(const char*);
|
||||
|
||||
#define exception construct(exception)
|
||||
/*#define exception construct(exception)
|
||||
class_t exception_class;
|
||||
class(exception, exception_class, object_class, true) {
|
||||
extends(object_t);
|
||||
|
@ -28,5 +28,6 @@ class(exception, exception_class, object_class, true) {
|
|||
|
||||
void method(exception, populate)(exception_t*);
|
||||
exception_t* method(exception, construct)(const char*);
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue