Skip to content

Commit

Permalink
Great Reorganization: Fixes
Browse files Browse the repository at this point in the history
* fix bug in codegen with enums/bitfields with base-type "ulong"
* fix item_tool_graphics_flag so it compiles (Toady's definition is already wrong)
* fix site_architecture_change (two anonymous unions with conflicting names)
* remove trailing whitespace
  • Loading branch information
quietust committed Feb 2, 2025
1 parent 9e0eddf commit 94c50b3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ sub get_primitive_base($;$) {
if ($base =~ /u?int[136]?[2468]_t/) {
header_ref("cstdint");
}
$primitive_types{$base} or die "Must be primitive: $base\n";

$base = primitive_type_name($base);

return $base;
}
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Template for new versions:
# Future

## Structures
- reorganize all structure definitions to match bay12 header layouts
- promote all bay12 structures, enums, and bitfields to top-level types
- fill in a bunch of structures that were missing
- fix various structure errors

# 51.02-r1

Expand Down
2 changes: 1 addition & 1 deletion df.d_interface.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5749,7 +5749,7 @@
<int16_t name='amount'/>
</struct-type>

<struct-type type-name='lookinfo_spoorst'>
<struct-type type-name='lookinfo_spoorst'>
<bitfield name='flag' type-name='spoor_flag'/>
<enum name='type' type-name='spoor_type'/>
<int32_t name='id1'/>
Expand Down
2 changes: 1 addition & 1 deletion df.itemdef.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
<flag-bit name='water'/>
<flag-bit name='dirt'/>
<flag-bit name='color_index' count='8'/>
<flag-bit name='localdef_shape_index' count='6'/> supposed to be 8, but the struct itself uses int32_t and only has room for 6
<flag-bit name='localdef_shape_index' count='5'/> supposed to be 8, but the struct itself uses int32_t and only has room for 5
</bitfield-type>

<enum-type type-name='item_tool_graphics_flag_material' base-type='int32_t'> bay12: ITEM_TOOL_GRAPHICS_FLAG_MATERIAL_*
Expand Down
2 changes: 1 addition & 1 deletion df.region.xml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
<int32_t name='y'/>
</struct-type>

<struct-type type-name='open_list_binary_heap_2Dst' since='v0.40.01'> bay12:
<struct-type type-name='open_list_binary_heap_2Dst' since='v0.40.01'>
<static-array name='node' count='80000' type-name='open_list_node_2Dst'/>
<int32_t name='size'/>
<int32_t name='x1'/>
Expand Down
2 changes: 1 addition & 1 deletion df.site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<int32_t name="year"/>
<int32_t name="year_tick" init-value='-1' comment='bay12: season_count'/>
<bitfield name="flags" base-type='uint32_t' type-name='site_architecture_flag'/>
<compound is-union='true' union-tag-field='type'>
<compound name='spec_flag' is-union='true' union-tag-field='type'>
<bitfield name="GENERALIZED_DAMAGE" base-type='uint32_t' type-name='site_architecture_flag_generalized_damage'/>
<bitfield name="GENERALIZED_DEATH" base-type='uint32_t' type-name='site_architecture_flag_generalized_death'/>
</compound>
Expand Down

0 comments on commit 94c50b3

Please sign in to comment.