Skip to content

Commit e443552

Browse files
authored
Merge branch 'master' into field_order
2 parents 31baa1b + d792883 commit e443552

9 files changed

Lines changed: 5584 additions & 5549 deletions

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
args: ['--fix=lf']
2121
- id: trailing-whitespace
2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.36.1
23+
rev: 0.37.0
2424
hooks:
2525
- id: check-github-workflows
2626
- repo: https://github.com/Lucas-C/pre-commit-hooks

Common.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,14 @@ my @primitive_type_list =
177177
size_t ssize_t
178178
s-float d-float
179179
bool flag-bit
180-
padding static-string);
180+
padding static-string static-wstring);
181181

182182
my %primitive_aliases = (
183183
'ulong' => 'unsigned long',
184184
's-float' => 'float',
185185
'd-float' => 'double',
186186
'static-string' => 'char',
187+
'static-wstring' => 'wchar_t',
187188
'flag-bit' => 'void',
188189
'padding' => 'void',
189190
);

SYNTAX.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ Primitive fields can be classified as following:
234234
4) String::
235235

236236
<static-string name='id' size='bytes'.../>
237+
<static-wstring name='id' size='words'.../>
237238
<ptr-string name='id'.../>
238239
<stl-string name='id'.../>
239240

StructFields.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ sub get_struct_field_type($;%) {
294294
my $count = $tag->getAttribute('size') || 0;
295295
$prefix = "char";
296296
$suffix = "[$count]";
297+
} elsif ($subtype eq 'static-wstring') {
298+
my $count = $tag->getAttribute('size') || 0;
299+
$prefix = "wchar_t";
300+
$suffix = "[$count]";
297301
} elsif ($subtype eq 'padding') {
298302
my $count = $tag->getAttribute('size') || 0;
299303
my $alignment = $tag->getAttribute('alignment') || 1;
@@ -572,6 +576,9 @@ sub render_field_metadata_rec($$) {
572576
if ($subtype eq 'static-string') {
573577
my $count = $field->getAttribute('size') || 0;
574578
push @field_defs, [ "${FLD}(STATIC_STRING, $name)", 'NULL', $count, $extra ];
579+
} elsif ($subtype eq 'static-wstring') {
580+
my $count = $field->getAttribute('size') || 0;
581+
push @field_defs, [ "${FLD}(PRIMITIVE, $name)", 'NULL', $count, $extra ];
575582
}
576583
} elsif ($meta eq 'global' || $meta eq 'compound') {
577584
if (is_attr_true($field, 'ld:enum-size-forced')) {

changelog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ Template for new versions:
1919
# Future
2020
- reordered XML attributes for consistency: ret-type, base-type, type-name, and pointer-type now appear first (and in that exact order)
2121

22+
## Structures
23+
24+
# 53.11-r1
25+
26+
## Structures
27+
- added codegen support for ``static-wstring`` (``wchar_t *``), required to support DF 53.11
28+
29+
# 53.10-r2
30+
2231
## Structures
2332
- added ``original-name`` attributes to all relevant objects
2433
- fixed numerous structure errors

data-definition.xsd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
<xs:element name="pointer" type="PointerField" />
240240
<xs:element name="ptr-string" type="PtrStringField" />
241241
<xs:element name="static-string" type="StaticStringField" />
242+
<xs:element name="static-wstring" type="StaticWStringField" />
242243
<xs:element name="padding" type="PaddingField" />
243244
</xs:choice>
244245
</xs:group>
@@ -555,6 +556,14 @@
555556
</xs:extension>
556557
</xs:complexContent>
557558
</xs:complexType>
559+
<xs:complexType name="StaticWStringField">
560+
<xs:complexContent>
561+
<xs:extension base="SimpleFieldType">
562+
<xs:attribute name="size" type="xs:positiveInteger" use="required">
563+
</xs:attribute>
564+
</xs:extension>
565+
</xs:complexContent>
566+
</xs:complexType>
558567
<xs:complexType name="PaddingField">
559568
<xs:complexContent>
560569
<xs:extension base="SimpleFieldType">

df.g_src.enabler.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@
202202
<int32_t name='y'/>
203203
</compound>
204204
<compound>
205-
<pointer type-name='static-string' name='text'/>
206-
<pointer type-name='static-string' name='caption'/>
205+
<pointer type-name='static-wstring' name='text'/>
206+
<pointer type-name='static-wstring' name='caption'/>
207207
<uint32_t name='type'/>
208208
</compound>
209209
</compound>

lower-1.xslt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,17 @@ Error: field <xsl:value-of select='$enum-key'/> corresponds to an enum value of
207207

208208
<prim-type ld:meta='bytes' ld:subtype='padding'/>
209209
<prim-type ld:meta='bytes' ld:subtype='static-string'/>
210+
<prim-type ld:meta='bytes' ld:subtype='static-wstring'/>
210211

211212
<prim-type ld:meta='pointer' ld:subtype='pointer'/>
212213
<prim-type ld:meta='pointer' ld:subtype='ptr-string' ld:is-container='true'>
213214
<static-string/>
214215
</prim-type>
215216

217+
<prim-type ld:meta='pointer' ld:subtype='ptr-wstring' ld:is-container='true'>
218+
<static-wstring/>
219+
</prim-type>
220+
216221
<prim-type ld:meta='primitive' ld:subtype='stl-string'/>
217222
<prim-type ld:meta='primitive' ld:subtype='stl-fstream'/>
218223
<prim-type ld:meta='primitive' ld:subtype='stl-mutex'/>

0 commit comments

Comments
 (0)