mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
Use "coroutine suspension point" consistently.
This commit is contained in:
1 parent
d83cf7f3d5
commit
e7873b5ca4
8 files changed
+136
-130
No files matched your search
@@ -6,13 +6,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be found
|
||||
// in the LICENSE file.
|
||||
|
||||
// Use switch cases for coroutine state, similar to the technique in
|
||||
// https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
|
||||
// Use switch cases for coroutine suspension points, similar to the technique
|
||||
// in https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
|
||||
//
|
||||
// We use a trivial macro instead of an explicit assignment and case statement
|
||||
// so that clang-format doesn't get confused by the unusual "case"s.
|
||||
#define PUFFS_COROUTINE_STATE(n) \
|
||||
coro_state = n; \
|
||||
#define PUFFS_COROUTINE_SUSPENSION_POINT(n) \
|
||||
coro_susp_point = n; \
|
||||
case n:
|
||||
|
||||
#define PUFFS_LOW_BITS(x, n) ((x) & ((1 << (n)) - 1))
|
||||
|
||||
Reference in new issue
Block a user