move type to where I can see it

Change-Id: I77f7e909828a67e1f095350bfdda7c5f4b00e1db
dest is signed

Change-Id: I2664fe8776f058ec2c8def730ff62baaf1e1980c
coverity#706101 Unintended sign extension

Change-Id: Ic044245aef233501c03e342084f5c27a1bee8d4e
coverity#706084 Unintended sign extension

and

coverity#706085 Unintended sign extension

Change-Id: I4bb617cd6927542dfef6dea89c5417ec4f9ed495
coverity#706376 Uncaught exception

Change-Id: Ic18823fd60826c144058df32c27ab25d58664e30
coverity#706600 Uncaught exception

Change-Id: I93868e6acc8e245f15ece38e00390dfc3bd9ee8c
coverity#707130 Uncaught exception

Change-Id: I76bbe1adb60e7662b4da1effc57feb54ad8733bd
coverity#707195 Uncaught exception

Change-Id: Idaeb36f01632cc91cc9fc3d5febd249e39e44ae2
coverity#707208 Uncaught exception

Change-Id: I7fe87d012acbd7bac9736ee5ff8c6abc0da3d129
coverity#707209 Uncaught exception

Change-Id: I876e25678d68cba09099776bf303a6540761d2ed
coverity#707210 Uncaught exception

Change-Id: I63013222988735f901b37584345b79659f69ad8a