Fix compiler warning for unused variables by using R__ASSERT instead of assert