From 3f17edb6aab146a9950f9d87934a81c6fca52524 Mon Sep 17 00:00:00 2001 From: Dylan Tuttle Date: Fri, 10 Nov 2023 11:09:18 -0800 Subject: [PATCH] Add explicit enum casts to prevent warnings Fix AIX warnings concerning comparisons between two enum values of different types by explicitly casting one value into the type of the other Signed-off-by: Dylan Tuttle --- runtime/compiler/compile/J9Compilation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/compiler/compile/J9Compilation.cpp b/runtime/compiler/compile/J9Compilation.cpp index 4064937c3da..5a11b14a243 100644 --- a/runtime/compiler/compile/J9Compilation.cpp +++ b/runtime/compiler/compile/J9Compilation.cpp @@ -341,12 +341,12 @@ J9::Compilation::printCompYieldStats() const char * J9::Compilation::getContextName(TR_CallingContext context) { - if (context == OMR::endOpts || context == TR_CallingContext::NO_CONTEXT) + if (context == (TR_CallingContext)OMR::endOpts || context == TR_CallingContext::NO_CONTEXT) return "NO CONTEXT"; - else if (context < OMR::numOpts) + else if (context < (TR_CallingContext)OMR::numOpts) return TR::Optimizer::getOptimizationName((OMR::Optimizations)context); else - return callingContextNames[context-OMR::numOpts]; + return callingContextNames[context - (TR_CallingContext)OMR::numOpts]; } void