cast loses precision

Change-Id: Ic688f08cada4ae70ea1dfb1e29e249a166456452
liblok: add include for size_t.

Change-Id: Icd7d78a332fbb67e32ab929f0afc5881ab7448eb