Signed number grief.

Noting that -1<<10 will generate the correct bit mask to sign-extend the ten-bit quantity to whatever word size… here you can see Bitlash doing the calculation on OS X with a 64 bit word size:

$ bitlash
bitlash here! v2.0 (c) 2012 Bill Roy -type HELP- 1000 bytes free
> print -1<<10:x
FFFFFFFFFFFFFC00

So, dhenry's proposal can be generalized to:

(signed short) ((x & 0x0200)?(x|(-1<<10)):x)

-br