Yes, this is because there is no subtraction operator for short ( Int16 ). Therefore, when you write:
_cap - _avail
which is effective:
(int) _cap - (int) _avail
... with the result int .
You can, of course, simply indicate the result:
_used = (short) (_cap - _avail);
source share