The "format" field introduced in patch 2/4 seems redundant with the version. I.e. I would delete the "version" field and derive it from the "format" field.
Also, please don't put more than one C statement on the same line.
Wrt patch 3/4, where are you running into this? Also, why do you need to change both the frontend and backend? (It also looks suspicious that you ensure the denominator is always nonzero in the frontend, but then check the denominator for zero in the backend rather than the numerator.)