cw.c: make some globals into locals.