cast to uint is required with some gcc versions, otherwise we get a shift-negative...