@@ -122,7 +122,7 @@ char* data_as_char(Smoc* moc, size_t offset = 0)
122
122
static
123
123
char * detoasted_offset (Smoc* moc, size_t offset = 0 )
124
124
{
125
- return offset + reinterpret_cast <char *>(&( moc-> version ) );
125
+ return offset + reinterpret_cast <char *>(moc) + offsetof (Smoc, version );
126
126
}
127
127
128
128
template <class X , class Y >
@@ -240,7 +240,7 @@ struct moc_tree_layout
240
240
{
241
241
rest_level = entries - rest_entries;
242
242
this_page = page_rest;
243
- }
243
+ }
244
244
else // there is only a single page fragment at this level
245
245
{
246
246
rest_level = 0 ;
@@ -526,13 +526,13 @@ get_moc_size(void* moc_in_context, pgs_error_handler error_out)
526
526
}
527
527
if (check == b_tree_inf)
528
528
throw std::logic_error (" infinite loop for MOC B-tree depth" );
529
-
529
+
530
530
// layout: start with the section of the ends of each B+-tree level
531
531
size_t depth = m.layout .size () - 1 ;
532
532
moc_size += depth * MOC_INDEX_ALIGN;
533
533
// layout: B+-tree layout, starting at root node
534
534
for (unsigned k = depth; k >= 1 ; --k)
535
- {
535
+ {
536
536
m.layout [k].layout_level (moc_size, MOC_TREE_ENTRY_SIZE);
537
537
}
538
538
if (m.layout [depth].level_end > static_cast <size_t >(
@@ -568,7 +568,7 @@ create_moc_release_context(void* moc_in_context, Smoc* moc,
568
568
569
569
hpint64 area = 0 ;
570
570
571
- // this guards against
571
+ // this guards against
572
572
char * moc_data = detoasted_offset (moc, 0 );
573
573
574
574
// All levels will be filled out from end to beginning such that
@@ -726,7 +726,7 @@ order_break(output_map & outputs, const moc_interval & x, int max_order)
726
726
void
727
727
ascii_out (std::string & m_s, char * s, Smoc* moc, int32 begin, int32 end,
728
728
int32 entry_size)
729
- {
729
+ {
730
730
// moc output fiddling:
731
731
int order = moc->order ;
732
732
m_s.reserve (end); // rough guess
@@ -817,7 +817,7 @@ create_moc_out_context(Smoc* moc, int32 end, pgs_error_handler error_out)
817
817
return ret;
818
818
}
819
819
820
- void
820
+ void
821
821
release_moc_out_context (moc_out_data out_context, pgs_error_handler error_out)
822
822
{
823
823
release_context<moc_output>(out_context.context , error_out);
0 commit comments