kernel: don't use typedef for enums or non-opaque structs

This commit is contained in:
2023-04-12 20:17:11 +01:00
parent 0d75e347e9
commit b6f8c1ccaa
51 changed files with 663 additions and 665 deletions

View File

@@ -7,7 +7,7 @@ struct test_object {
char name[OBJECT_NAME_MAX];
};
static kern_status_t test_query_name(object_t *obj, char out[OBJECT_NAME_MAX])
static kern_status_t test_query_name(struct object *obj, char out[OBJECT_NAME_MAX])
{
struct test_object *test = object_data(obj);
strncpy(out, test->name, OBJECT_NAME_MAX);
@@ -15,7 +15,7 @@ static kern_status_t test_query_name(object_t *obj, char out[OBJECT_NAME_MAX])
return KERN_OK;
}
static object_type_t test_type = {
static struct object_type test_type = {
.ob_name = "test",
.ob_size = sizeof(struct test_object),
.ob_ops = {
@@ -23,7 +23,7 @@ static object_type_t test_type = {
},
};
static void print_object_tree(object_t *obj, int depth)
static void print_object_tree(struct object *obj, int depth)
{
char msg[256] = {0};
int len = 0;
@@ -38,7 +38,7 @@ static void print_object_tree(object_t *obj, int depth)
len += snprintf(msg + len, sizeof msg - len, "%s", name);
printk(msg);
object_t *child = NULL;
struct object *child = NULL;
size_t i = 0;
while (1) {
@@ -57,7 +57,7 @@ static int run_obj_tests(void)
{
object_type_register(&test_type);
object_t *test_obj = object_create(&test_type);
struct object *test_obj = object_create(&test_type);
struct test_object *test = object_data(test_obj);
snprintf(test->name, sizeof test->name, "object1");
kern_status_t status = object_publish(global_namespace(), "/misc/objects", test_obj);