adding casts to segmeent to reduce warnings
Merge branch 'feature/issue-682-remove-warnings-v2.3.0' of https://github.com/stan-dev/stan into feature/issue-682-remove-warnings-v2.3.0
removed more warnings