Added const where possible in spsegment.