diff --git a/example/animal.c b/example/animal.c index 1f9fb38..be2adc9 100644 --- a/example/animal.c +++ b/example/animal.c @@ -38,8 +38,8 @@ */ static char *dupstr(const char *text) { - size_t len; - char *copy; + size_t len; + char *copy; if (!text) return NULL; diff --git a/example/animal.h b/example/animal.h index df864f9..dab204f 100644 --- a/example/animal.h +++ b/example/animal.h @@ -38,10 +38,10 @@ struct AnimalVTable { * struct as their first member, which makes the upcast free. */ struct Animal { - ooc_object object; + ooc_object object; const AnimalVTable *vtable; - char *name; - int age; + char *name; + int age; /* * Two fields that belong to the class alone, told apart by their leading @@ -52,8 +52,8 @@ struct Animal { * nothing outside Animal can read or write it by name at all. Both are set * from the struct definition below, where the members are in view. */ - int _id; - int __legs; + int _id; + int __legs; }; /* diff --git a/example/cat.c b/example/cat.c index 55efdab..69b08a2 100644 --- a/example/cat.c +++ b/example/cat.c @@ -43,8 +43,8 @@ */ static char *dupstr(const char *text) { - size_t len; - char *copy; + size_t len; + char *copy; if (!text) return NULL; @@ -157,10 +157,10 @@ static const ooc_field Cat_fields[] = { * Dog stay distinguishable while both are passed around as Animal. */ const ooc_class Cat_class = { - .size = sizeof(Cat), + .size = sizeof(Cat), .destroy = destroy, - .super = &Animal_class, - .fields = Cat_fields, + .super = &Animal_class, + .fields = Cat_fields, }; /* @@ -203,8 +203,8 @@ Cat *cat_new(const char *name, int age, const char *colour) } cat->animal.vtable = &vt; - cat->colour = dupstr(colour); - cat->_lives = 9; + cat->colour = dupstr(colour); + cat->_lives = 9; if (!cat->colour) { ooc_release(cat); diff --git a/example/cat.h b/example/cat.h index 5b46d91..c662cb3 100644 --- a/example/cat.h +++ b/example/cat.h @@ -32,7 +32,7 @@ typedef struct Cat Cat; */ struct Cat { Animal animal; - char *colour; + char *colour; /* * Private to Cat, and readable by name: one leading underscore stops @@ -40,7 +40,7 @@ struct Cat { * the same way, so the rule is the one in the library rather than something * the subclass has to repeat. */ - int _lives; + int _lives; }; /* diff --git a/example/dog.c b/example/dog.c index e4323e5..f33fbcb 100644 --- a/example/dog.c +++ b/example/dog.c @@ -41,8 +41,8 @@ */ static char *dupstr(const char *text) { - size_t len; - char *copy; + size_t len; + char *copy; if (!text) return NULL; @@ -128,7 +128,7 @@ static const AnimalVTable vt = { */ static const ooc_field Dog_fields[] = { { "breed", offsetof(Dog, breed), sizeof(((Dog *)0)->breed), 1 }, - { NULL, 0, 0, 0 }, + { NULL, 0, 0, 0 }, }; /* @@ -181,7 +181,7 @@ Dog *dog_new(const char *name, int age, const char *breed) } dog->animal.vtable = &vt; - dog->breed = dupstr(breed); + dog->breed = dupstr(breed); if (!dog->breed) { ooc_release(dog); diff --git a/example/dog.h b/example/dog.h index cb0b48f..29bc2be 100644 --- a/example/dog.h +++ b/example/dog.h @@ -31,7 +31,7 @@ typedef struct Dog Dog; */ struct Dog { Animal animal; - char *breed; + char *breed; }; /*