Make out arguments non-reference types.

Also, tidy some portable related code.

Change-Id: I67c8aa52eef8b556ca117ecda1b1e75465ba06a5
22 files changed