This solution may not be what you are looking for, but I would use the overload function to create one version of void foo(int) that processes the data as normal, and another version with the signature void foo(short) that processes the data, such like a mistake. For instance:
void foo(int i) {
source share