You instead want to just memset() the entire changed structure to ~0.
That doesn't seem to work very well, the state application logic expects some bitmasks to be contained within supported limits. I instead added setting those extra states manually.