mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
branches/zip: Minor cleanup.
dtuple_create(): Simplify a pointer expression. Flag the fields uninitialized after initializing them in the debug version. dtuple_t: Only declare magic_n if UNIV_DEBUG is defined. The field is not assigned to nor tested unless UNIV_DEBUG is defined.
This commit is contained in:
parent
051545ad66
commit
9b1d1fff14
2 changed files with 6 additions and 2 deletions
|
@ -410,9 +410,11 @@ struct dtuple_struct {
|
|||
UT_LIST_NODE_T(dtuple_t) tuple_list;
|
||||
/* data tuples can be linked into a
|
||||
list using this field */
|
||||
#ifdef UNIV_DEBUG
|
||||
ulint magic_n;
|
||||
# define DATA_TUPLE_MAGIC_N 65478679
|
||||
#endif /* UNIV_DEBUG */
|
||||
};
|
||||
#define DATA_TUPLE_MAGIC_N 65478679
|
||||
|
||||
/* A slot for a field in a big rec vector */
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ dtuple_create(
|
|||
tuple->info_bits = 0;
|
||||
tuple->n_fields = n_fields;
|
||||
tuple->n_fields_cmp = n_fields;
|
||||
tuple->fields = (dfield_t*)(((byte*)tuple) + sizeof(dtuple_t));
|
||||
tuple->fields = (dfield_t*) &tuple[1];
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
tuple->magic_n = DATA_TUPLE_MAGIC_N;
|
||||
|
@ -343,6 +343,8 @@ dtuple_create(
|
|||
dfield_get_type(field)->mtype = DATA_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
UNIV_MEM_INVALID(tuple->fields, n_fields * sizeof *tuple->fields);
|
||||
#endif
|
||||
return(tuple);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue