diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-04-18 14:03:06 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-04-18 14:03:06 -0400 |
commit | c43a07086bdeefe029c5b6da4ec1c8020126d5ca (patch) | |
tree | d497b43234d5d59ca40ceb22154d24e15fdeb395 /util.c | |
parent | c6f3adc52d375d434e3dfd2d23056f0bfdbcdc67 (diff) | |
download | roux-c43a07086bdeefe029c5b6da4ec1c8020126d5ca.tar.gz |
factor some subtyping logic in clsmerge()
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/util.c b/util.c index 96efdfd..527f214 100644 --- a/util.c +++ b/util.c @@ -189,6 +189,23 @@ vgrow(void *vp, ulong len) } int +clsmerge(short *pk, short k) +{ + short k1; + + k1 = *pk; + if (k1 == Kx) { + *pk = k; + return 0; + } + if ((k1 == Kw && k == Kl) || (k1 == Kl && k == Kw)) { + *pk = Kw; + return 0; + } + return k1 != k; +} + +int phicls(int t, Tmp *tmp /*, int c*/) { if (tmp[t].phi) |