long& l = out.iword(s_iosIndex);
if(l == 0) {
// set the default print depth on this ostream
- if(&Options::current() != NULL) {
+ if(not Options::isCurrentNull()) {
l = options::defaultExprDepth();
}
if(l == 0) {
if(l == 0) {
// set the default dag setting on this ostream
// (offset by one to detect whether default has been set yet)
- if(&Options::current() != NULL) {
+ if(not Options::isCurrentNull()) {
l = options::defaultDagThresh() + 1;
}
if(l == 0) {
if(l == 0) {
// set the default language on this ostream
// (offset by one to detect whether default has been set yet)
- if(&Options::current() != NULL) {
+ if(not Options::isCurrentNull()) {
l = options::outputLanguage() + 1;
}
if(l <= 0 || l > language::output::LANG_MAX) {
public:
+ /** Return true if current Options are null */
+ static inline bool isCurrentNull() {
+ return s_current == NULL;
+ }
+
/** Get the current Options in effect */
static inline Options& current() {
return *s_current;
//
// Options can be null in certain circumstances (e.g., when printing
// the singleton "null" expr. So we guard against segfault
- if(&Options::current() != NULL) {
+ if(not Options::isCurrentNull()) {
if(options::outputLanguage.wasSetByUser()) {
lang = options::outputLanguage();
}