compass baring -180 to +180 rollover when adding calibration help

The output form my gyro will give a reading from -180 to 180 and roll over. I need to add an offset but maintain the rollover

int Baring = 170;
int CalBaring;
CalBaring= Baring + 100;// adjust for error
if(CalBaring > 180) CalBaring= -180 + (CalBaring- 180); // rollover to negative
if(CalBaring < -180) CalBaring= 180 - (CalBaring+ 180); // rollover to positive

Serial.print(CalBaring)

Is there a simpler way than doing it with all the if statements?
I tried searching for this on google but I’m not sure exactly what to look for.

Combine the addition or subtraction to one operation.

if(CalBaring > 180) CalBaring= CalBaring - 360; // rollover to negative
if(CalBaring < -180) CalBaring= CalBaring + 360; // rollover to positive

Is there a simpler way than doing it with all the if statements?

All the if statements? There are two of them. No, there is no way to test that a value off two different ends of the range, and perform two different actions, with less than two if statements.