summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-09-27 02:43:50 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-09-27 02:43:50 +0300
commita2b69e5b9479ddeba3c737c8ef01764d5454520c (patch)
tree9ef02540b4f9c877ab73d8ca978bc89f073fd2e6 /spec
parent5d253b30c5d84857d06393b77ce91fb974061665 (diff)
implement the binary number type
Diffstat (limited to 'spec')
-rw-r--r--spec/flac.fspec32
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/flac.fspec b/spec/flac.fspec
index 973cc47..9acd9dc 100644
--- a/spec/flac.fspec
+++ b/spec/flac.fspec
@@ -80,7 +80,7 @@ struct flac {
struct {
u64 offset_in_samples;
u8 index;
- u24 reserved;
+ u24 reserved nul;
} indices[num_index_points];
} track[num_tracks];
} cuesheet;
@@ -101,7 +101,7 @@ struct flac {
} data;
} metadata[until (metadata.last_metadata_block)];
struct {
- u14 sync_code | matches(b11111111111110);
+ u14 sync_code | matches(0b11111111111110);
u1 reserved1 nul;
u1 blocking_strategy;
u4 block_size_in_inter_channel_samples;
@@ -114,13 +114,13 @@ struct flac {
1) u8 sample['\0':6] | encoding('utf8') hex;
} index;
select (block_size_in_inter_channel_samples) {
- b0110) u8 value1;
- b0111) u16 value2;
+ 0b0110) u8 value1;
+ 0b0111) u16 value2;
} block_size_bit;
select (sample_rate) {
- b1100) u8 value_in_kHz;
- b1101) u16 value_in_Hz;
- b1110) u16 value_in_tens_of_Hz;
+ 0b1100) u8 value_in_kHz;
+ 0b1101) u16 value_in_Hz;
+ 0b1110) u16 value_in_tens_of_Hz;
} sample_rate_bit;
u8 crc_8 hex;
struct {
@@ -129,15 +129,15 @@ struct flac {
u1 wasted_bits_per_sample[until (wasted_bits_per_sample)];
select (type) {
// missing verbatim and lpc
- b000000)
+ 0b000000)
struct {
select (sample_size_in_bits) {
- b000) u1 v[metadata[0].data.streaminfo.bps];
- b001) u8 v8;
- b011) u12 v12;
- b100) u16 v16;
- b101) u20 v20;
- b110) u24 v24;
+ 0b000) u1 v[metadata[0].data.streaminfo.bps];
+ 0b001) u8 v8;
+ 0b011) u12 v12;
+ 0b100) u16 v16;
+ 0b101) u20 v20;
+ 0b110) u24 v24;
} value;
} constant;
testbits(type, '001xxxx'))
@@ -146,7 +146,7 @@ struct flac {
struct {
u2 method_type;
select (method_type) {
- b00)
+ 0b00)
struct {
u4 order;
struct {
@@ -154,7 +154,7 @@ struct flac {
u1 todo;
} partition;
} partitioned_rice;
- b01)
+ 0b01)
struct {
u4 order;
struct {