@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
122
122
soffset_t vector_index, IterationVisitor *visitor) {
123
123
switch (type) {
124
124
case ET_UTYPE: {
125
- auto tval = * reinterpret_cast < const uint8_t * >(val);
125
+ auto tval = ReadScalar< uint8_t >(val);
126
126
visitor->UType (tval, EnumName (tval, type_table));
127
127
break ;
128
128
}
129
129
case ET_BOOL: {
130
- visitor->Bool (* reinterpret_cast < const uint8_t * >(val) != 0 );
130
+ visitor->Bool (ReadScalar< uint8_t >(val) != 0 );
131
131
break ;
132
132
}
133
133
case ET_CHAR: {
134
- auto tval = * reinterpret_cast < const int8_t * >(val);
134
+ auto tval = ReadScalar< int8_t >(val);
135
135
visitor->Char (tval, EnumName (tval, type_table));
136
136
break ;
137
137
}
138
138
case ET_UCHAR: {
139
- auto tval = * reinterpret_cast < const uint8_t * >(val);
139
+ auto tval = ReadScalar< uint8_t >(val);
140
140
visitor->UChar (tval, EnumName (tval, type_table));
141
141
break ;
142
142
}
143
143
case ET_SHORT: {
144
- auto tval = * reinterpret_cast < const int16_t * >(val);
144
+ auto tval = ReadScalar< int16_t >(val);
145
145
visitor->Short (tval, EnumName (tval, type_table));
146
146
break ;
147
147
}
148
148
case ET_USHORT: {
149
- auto tval = * reinterpret_cast < const uint16_t * >(val);
149
+ auto tval = ReadScalar< uint16_t >(val);
150
150
visitor->UShort (tval, EnumName (tval, type_table));
151
151
break ;
152
152
}
153
153
case ET_INT: {
154
- auto tval = * reinterpret_cast < const int32_t * >(val);
154
+ auto tval = ReadScalar< int32_t >(val);
155
155
visitor->Int (tval, EnumName (tval, type_table));
156
156
break ;
157
157
}
158
158
case ET_UINT: {
159
- auto tval = * reinterpret_cast < const uint32_t * >(val);
159
+ auto tval = ReadScalar< uint32_t >(val);
160
160
visitor->UInt (tval, EnumName (tval, type_table));
161
161
break ;
162
162
}
163
163
case ET_LONG: {
164
- visitor->Long (* reinterpret_cast < const int64_t * >(val));
164
+ visitor->Long (ReadScalar< int64_t >(val));
165
165
break ;
166
166
}
167
167
case ET_ULONG: {
168
- visitor->ULong (* reinterpret_cast < const uint64_t * >(val));
168
+ visitor->ULong (ReadScalar< uint64_t >(val));
169
169
break ;
170
170
}
171
171
case ET_FLOAT: {
172
- visitor->Float (* reinterpret_cast < const float * >(val));
172
+ visitor->Float (ReadScalar< float >(val));
173
173
break ;
174
174
}
175
175
case ET_DOUBLE: {
176
- visitor->Double (* reinterpret_cast < const double * >(val));
176
+ visitor->Double (ReadScalar< double >(val));
177
177
break ;
178
178
}
179
179
case ET_STRING: {
0 commit comments