Skip to content

Commit

Permalink
Clean up a few more (type ...) and (typename ...) constructs.
Browse files Browse the repository at this point in the history
Only use `(typename ...)` to declare named types; don't use it for
inline types.
  • Loading branch information
sunfishcode committed Sep 12, 2019
1 parent 97469cd commit 5a7d81d
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions design/wasi_unstable/wasi_unstable.wati
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@
;; The type of the event that occurred.
(field $type $eventtype_t)
(field $u
(typename union
(union
;; When type is `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`:
(field $fd_readwrite
(typename stuct
(struct
;; The number of bytes available for reading or writing.
(field $nbytes $filesize_t)
;; The state of the file descriptor.
Expand Down Expand Up @@ -541,32 +541,26 @@
;; The type of the event to which to subscribe.
(field $type $eventtype_t)
(field
(type
(union
;; When type is `__WASI_EVENTTYPE_CLOCK`:
(field $clock
(typename
(struct
;; The user-defined unique identifier of the clock.
(field $identifier $userdata_t)
;; The clock against which to compare the timestamp.
(field $clock_id $clockid_t)
;; The absolute or relative timestamp.
(field $timeout $timestamp_t)
;; The amount of time that the implementation may wait additionally to coalesce with other events.
;; Flags specifying whether the timeout is absolute or relative
(field $precision $timestamp_t)
)
)
(union
;; When type is `__WASI_EVENTTYPE_CLOCK`:
(field $clock
(struct
;; The user-defined unique identifier of the clock.
(field $identifier $userdata_t)
;; The clock against which to compare the timestamp.
(field $clock_id $clockid_t)
;; The absolute or relative timestamp.
(field $timeout $timestamp_t)
;; The amount of time that the implementation may wait additionally to coalesce with other events.
;; Flags specifying whether the timeout is absolute or relative
(field $precision $timestamp_t)
)
;; When type is `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`:
(field $fd_readwrite
(type
(struct
;; The file descriptor on which to wait for it to become ready for reading or writing.
(field $file_descriptor $fd_t)
)
)
)
;; When type is `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`:
(field $fd_readwrite
(struct
;; The file descriptor on which to wait for it to become ready for reading or writing.
(field $file_descriptor $fd_t)
)
)
)
Expand Down

0 comments on commit 5a7d81d

Please sign in to comment.