TLV opaqueToInt error

Sign extension causes some conversion error in TLV decoding.

To reproduce the error you may run the /test/TLV/ example. In the second decode I get wrong value "as int" for resource instances 7/0, 7/1, 8/0  and 8/1; the int value is totally differente from the hex printed in the line before.