qom/object.c: rename type_class_init() to type_initialize()
Function name type_class_init() gave us a wrong impression of separation of type's "class" and "object" entities initialization. Name type_initialize() is more appropriate for type_class_init() function (considering what operations it performs). Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
		
							parent
							
								
									aca59af612
								
							
						
					
					
						commit
						ac4510337d
					
				
							
								
								
									
										12
									
								
								qom/object.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								qom/object.c
									
									
									
									
									
								
							@ -206,7 +206,7 @@ static void type_class_interface_init(TypeImpl *ti, InterfaceImpl *iface)
 | 
				
			|||||||
    g_free(name);
 | 
					    g_free(name);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void type_class_init(TypeImpl *ti)
 | 
					static void type_initialize(TypeImpl *ti)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    size_t class_size = sizeof(ObjectClass);
 | 
					    size_t class_size = sizeof(ObjectClass);
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
@ -224,7 +224,7 @@ static void type_class_init(TypeImpl *ti)
 | 
				
			|||||||
    if (type_has_parent(ti)) {
 | 
					    if (type_has_parent(ti)) {
 | 
				
			||||||
        TypeImpl *parent = type_get_parent(ti);
 | 
					        TypeImpl *parent = type_get_parent(ti);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        type_class_init(parent);
 | 
					        type_initialize(parent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        class_size = parent->class_size;
 | 
					        class_size = parent->class_size;
 | 
				
			||||||
        g_assert(parent->class_size <= ti->class_size);
 | 
					        g_assert(parent->class_size <= ti->class_size);
 | 
				
			||||||
@ -278,7 +278,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
 | 
				
			|||||||
    Object *obj = data;
 | 
					    Object *obj = data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    g_assert(type != NULL);
 | 
					    g_assert(type != NULL);
 | 
				
			||||||
    type_class_init(type);
 | 
					    type_initialize(type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    g_assert(type->instance_size >= sizeof(Object));
 | 
					    g_assert(type->instance_size >= sizeof(Object));
 | 
				
			||||||
    g_assert(type->abstract == false);
 | 
					    g_assert(type->abstract == false);
 | 
				
			||||||
@ -367,7 +367,7 @@ Object *object_new_with_type(Type type)
 | 
				
			|||||||
    Object *obj;
 | 
					    Object *obj;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    g_assert(type != NULL);
 | 
					    g_assert(type != NULL);
 | 
				
			||||||
    type_class_init(type);
 | 
					    type_initialize(type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    obj = g_malloc(type->instance_size);
 | 
					    obj = g_malloc(type->instance_size);
 | 
				
			||||||
    object_initialize_with_type(obj, type);
 | 
					    object_initialize_with_type(obj, type);
 | 
				
			||||||
@ -540,7 +540,7 @@ ObjectClass *object_class_by_name(const char *typename)
 | 
				
			|||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    type_class_init(type);
 | 
					    type_initialize(type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return type->class;
 | 
					    return type->class;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -560,7 +560,7 @@ static void object_class_foreach_tramp(gpointer key, gpointer value,
 | 
				
			|||||||
    TypeImpl *type = value;
 | 
					    TypeImpl *type = value;
 | 
				
			||||||
    ObjectClass *k;
 | 
					    ObjectClass *k;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    type_class_init(type);
 | 
					    type_initialize(type);
 | 
				
			||||||
    k = type->class;
 | 
					    k = type->class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!data->include_abstract && type->abstract) {
 | 
					    if (!data->include_abstract && type->abstract) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user