diff --git a/layout.c b/layout.c index fc1bf09..269d6ff 100644 --- a/layout.c +++ b/layout.c @@ -63,6 +63,7 @@ bool json_read_object_layout( struct json_pull_parser* jpp, struct json_object_f } if( !json_pull_parser_end_object( jpp, &save ) ) { + printf( "Failed!\n" ); return false; } @@ -73,6 +74,7 @@ bool json_read_object_layout( struct json_pull_parser* jpp, struct json_object_f } } + //printf( "parsed\n" ); return true; } bool json_read_object_layout_from_FILE_ex( FILE* f, struct json_object_field* layout, void* ptr, int flags ) diff --git a/layout.h b/layout.h index c2c65b8..3bcf304 100644 --- a/layout.h +++ b/layout.h @@ -143,7 +143,7 @@ void json_write_field_name( struct json_writer* jw, const char* field_name ); struct json_field_type name ## _type = { \ .reader = json_field_object_type_reader, \ .writer = json_field_object_type_writer, \ - .size = sizeof( struct name ), \ + .size = sizeof( struct name* ), \ .layout = name ## _layout, \ .alloc = name ## _alloc_shim , \ .free = name ## _free_shim, \ @@ -162,7 +162,7 @@ void name ## _free_shim( void* ptr )\ struct json_field_type name ## _type = { \ .reader = json_field_object_type_reader, \ .writer = json_field_object_type_writer, \ - .size = sizeof( struct name ), \ + .size = sizeof( struct name* ), \ .layout = name ## _layout, \ .alloc = name ## _alloc_shim , \ .free = name ## _free_shim, \ diff --git a/layout/array.c b/layout/array.c index f7c5139..8456820 100644 --- a/layout/array.c +++ b/layout/array.c @@ -24,6 +24,10 @@ static bool json_field_array_reader( struct json_pull_parser* jpp, void* field_d memset(item,0,sizeof(item)); while( item_type->reader( jpp, item, &item_field ) ) { array_append( field, item_type->size, item ); + /* + printf( "field = " ); + array_print_debug( field, item_type->size, stdout ); + //*/ memset(item,0,sizeof(item)); }