td_var: avoid arithmetic on a pointer to void cast (#1096)