Minor cleanup and use byte(b)/short(s)/float(p)
Clamp pos[2] when transform 2D only
pos[0]/[1] are signed while pos[2] is unsigned in 2D transform
Merge pull request #742 from raven02/patch-2

Minor cleanup and use byte(b)/short(s)/float(p)