Use "coroutine suspension point" consistently.

This commit is contained in:
Nigel Tao committed 2017-07-13 10:46:05 +10:00
1 parent d83cf7f3d5
commit e7873b5ca4
8 files changed
+136 -130

No files matched your search

+4 -4
View File
@@ -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))