@@ -78,7 +78,7 @@ schema_index_free(struct mh_schema_index_t *schema) {
7878 do {
7979 struct schema_key key_number = {
8080 (void * )& (ivalue -> index_number ),
81- sizeof (uint32_t )
81+ sizeof (uint32_t ), 0
8282 };
8383 index_slot = mh_schema_index_find (schema , & key_number ,
8484 NULL );
@@ -90,7 +90,7 @@ schema_index_free(struct mh_schema_index_t *schema) {
9090 do {
9191 struct schema_key key_string = {
9292 ivalue -> index_name ,
93- ivalue -> index_name_len
93+ ivalue -> index_name_len , 0
9494 };
9595 index_slot = mh_schema_index_find (schema , & key_string ,
9696 NULL );
@@ -170,7 +170,7 @@ schema_space_free(struct mh_schema_space_t *schema) {
170170 do {
171171 struct schema_key key_number = {
172172 (void * )& (svalue -> space_number ),
173- sizeof (uint32_t )
173+ sizeof (uint32_t ), 0
174174 };
175175 space_slot = mh_schema_space_find (schema , & key_number ,
176176 NULL );
@@ -182,7 +182,7 @@ schema_space_free(struct mh_schema_space_t *schema) {
182182 do {
183183 struct schema_key key_string = {
184184 svalue -> space_name ,
185- svalue -> space_name_len
185+ svalue -> space_name_len , 0
186186 };
187187 space_slot = mh_schema_space_find (schema , & key_string ,
188188 NULL );
@@ -404,16 +404,18 @@ tarantool_schema_add_spaces(
404404 struct mh_schema_space_t * schema = schema_obj -> space_hash ;
405405 const char * tuple = data ;
406406 if (mp_check (& tuple , tuple + size ))
407- return -1 ;
407+ goto error ;
408408 tuple = data ;
409409 if (mp_typeof (* tuple ) != MP_ARRAY )
410- return -1 ;
410+ goto error ;
411411 uint32_t space_count = mp_decode_array (& tuple );
412412 while (space_count -- > 0 ) {
413413 if (schema_add_space (schema , & tuple ))
414- return -1 ;
414+ goto error ;
415415 }
416416 return 0 ;
417+ error :
418+ return -1 ;
417419}
418420
419421static inline int schema_add_index (
@@ -449,8 +451,8 @@ static inline int schema_add_index(
449451 case 0 :
450452 if (mp_typeof (* tuple ) != MP_UINT )
451453 goto error ;
452- uint32_t space_number = mp_decode_uint (& tuple );
453- space_key .id = (void * )& (space_number );
454+ space_key . number = mp_decode_uint (& tuple );
455+ space_key .id = (void * )& (space_key . number );
454456 space_key .id_len = sizeof (uint32_t );
455457 break ;
456458 /* index ID */
@@ -520,16 +522,18 @@ tarantool_schema_add_indexes(
520522 struct mh_schema_space_t * schema = schema_obj -> space_hash ;
521523 const char * tuple = data ;
522524 if (mp_check (& tuple , tuple + size ))
523- return -1 ;
525+ goto error ;
524526 tuple = data ;
525527 if (mp_typeof (* tuple ) != MP_ARRAY )
526- return -1 ;
528+ goto error ;
527529 uint32_t space_count = mp_decode_array (& tuple );
528530 while (space_count -- > 0 ) {
529531 if (schema_add_index (schema , & tuple ))
530- return -1 ;
532+ goto error ;
531533 }
532534 return 0 ;
535+ error :
536+ return -1 ;
533537}
534538
535539int32_t
@@ -540,7 +544,7 @@ tarantool_schema_get_sid_by_string(
540544 struct mh_schema_space_t * schema = schema_obj -> space_hash ;
541545 struct schema_key space_key = {
542546 space_name ,
543- space_name_len
547+ space_name_len , 0
544548 };
545549 mh_int_t space_slot = mh_schema_space_find (schema , & space_key , NULL );
546550 if (space_slot == mh_end (schema ))
@@ -558,7 +562,7 @@ tarantool_schema_get_iid_by_string(
558562 struct mh_schema_space_t * schema = schema_obj -> space_hash ;
559563 struct schema_key space_key = {
560564 (void * )& sid ,
561- sizeof (uint32_t )
565+ sizeof (uint32_t ), 0
562566 };
563567 mh_int_t space_slot = mh_schema_space_find (schema , & space_key , NULL );
564568 if (space_slot == mh_end (schema ))
@@ -567,7 +571,7 @@ tarantool_schema_get_iid_by_string(
567571 space_slot );
568572 struct schema_key index_key = {
569573 index_name ,
570- index_name_len
574+ index_name_len , 0
571575 };
572576 mh_int_t index_slot = mh_schema_index_find (space -> index_hash ,
573577 & index_key , NULL );
@@ -586,7 +590,7 @@ tarantool_schema_get_fid_by_string(
586590 struct mh_schema_space_t * schema = schema_obj -> space_hash ;
587591 struct schema_key space_key = {
588592 (void * )& sid ,
589- sizeof (uint32_t )
593+ sizeof (uint32_t ), 0
590594 };
591595 mh_int_t space_slot = mh_schema_space_find (schema , & space_key , NULL );
592596 if (space_slot == mh_end (schema ))
0 commit comments