@@ -137,10 +137,10 @@ size_t OGTupleElementOffsetChecked(OGTupleType tuple_type, size_t index, OGTypeI
137137 #endif
138138}
139139
140- void *update (void * dst_ptr, const void *src_ptr, const OG::swift::metadata * metadata, OGTupleCopyOptions mode ) {
140+ void *update (void * dst_ptr, const void *src_ptr, const OG::swift::metadata * metadata, OGTupleCopyOptions options ) {
141141 auto dst = reinterpret_cast <swift::OpaqueValue *>(dst_ptr);
142142 auto src = reinterpret_cast <swift::OpaqueValue *>(const_cast <void *>(src_ptr));
143- switch (mode ) {
143+ switch (options ) {
144144 case OGTupleCopyOptionsAssignCopy:
145145 return metadata->vw_assignWithCopy (dst, src);
146146 case OGTupleCopyOptionsInitCopy:
@@ -150,11 +150,11 @@ void *update(void* dst_ptr, const void *src_ptr, const OG::swift::metadata * met
150150 case OGTupleCopyOptionsInitTake:
151151 return metadata->vw_initializeWithTake (dst, src);
152152 default :
153- OG::precondition_failure (" unknown copy options: %d" , mode );
153+ OG::precondition_failure (" unknown copy options: %d" , options );
154154 }
155155}
156156
157- void *OGTupleSetElement (OGTupleType tuple_type, void * tuple_value, size_t index, const void *element_value, OGTypeID check_type, OGTupleCopyOptions mode ) {
157+ void *OGTupleSetElement (OGTupleType tuple_type, void * tuple_value, size_t index, const void *element_value, OGTypeID check_type, OGTupleCopyOptions options ) {
158158 #ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED
159159 auto metadata = reinterpret_cast <OG::swift::metadata const *>(tuple_type);
160160 if (metadata->getKind () != swift::MetadataKind::Tuple) {
@@ -164,7 +164,7 @@ void *OGTupleSetElement(OGTupleType tuple_type, void* tuple_value, size_t index,
164164 if (reinterpret_cast <OGTypeID>(metadata) != check_type) {
165165 OG::precondition_failure (" element type mismatch" );
166166 }
167- return update (tuple_value, element_value, metadata, mode );
167+ return update (tuple_value, element_value, metadata, options );
168168 }
169169 auto tuple_metadata = reinterpret_cast <const swift::TupleTypeMetadata *>(metadata);
170170 if (tuple_metadata->NumElements <= index) {
@@ -174,13 +174,13 @@ void *OGTupleSetElement(OGTupleType tuple_type, void* tuple_value, size_t index,
174174 if (reinterpret_cast <OGTypeID>(element.Type ) != check_type) {
175175 OG::precondition_failure (" element type mismatch" );
176176 }
177- return update ((void *)(( intptr_t )tuple_value + index) , element_value, metadata, mode );
177+ return update ((void *)(element. findIn ( reinterpret_cast <swift::OpaqueValue *>(tuple_value))) , element_value, reinterpret_cast < const OG::swift:: metadata *>(element. Type ), options );
178178 #else
179179 return nullptr ;
180180 #endif
181181}
182182
183- void *OGTupleGetElement (OGTupleType tuple_type, void * tuple_value, size_t index, void *element_value, OGTypeID check_type, OGTupleCopyOptions mode ) {
183+ void *OGTupleGetElement (OGTupleType tuple_type, void * tuple_value, size_t index, void *element_value, OGTypeID check_type, OGTupleCopyOptions options ) {
184184 #ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED
185185 auto metadata = reinterpret_cast <OG::swift::metadata const *>(tuple_type);
186186 if (metadata->getKind () != swift::MetadataKind::Tuple) {
@@ -190,7 +190,7 @@ void *OGTupleGetElement(OGTupleType tuple_type, void* tuple_value, size_t index,
190190 if (reinterpret_cast <OGTypeID>(metadata) != check_type) {
191191 OG::precondition_failure (" element type mismatch" );
192192 }
193- return update (element_value, tuple_value, metadata, mode );
193+ return update (element_value, tuple_value, metadata, options );
194194 }
195195 auto tuple_metadata = reinterpret_cast <const swift::TupleTypeMetadata *>(metadata);
196196 if (tuple_metadata->NumElements <= index) {
@@ -200,7 +200,7 @@ void *OGTupleGetElement(OGTupleType tuple_type, void* tuple_value, size_t index,
200200 if (reinterpret_cast <OGTypeID>(element.Type ) != check_type) {
201201 OG::precondition_failure (" element type mismatch" );
202202 }
203- return update (element_value, (const void *)(( intptr_t )tuple_value + index), metadata, mode );
203+ return update (element_value, (const void *)(element. findIn ( reinterpret_cast <swift::OpaqueValue *>(tuple_value))), reinterpret_cast < const OG::swift:: metadata *>(element. Type ), options );
204204 #else
205205 return nullptr ;
206206 #endif
0 commit comments