Skip to content

Commit

Permalink
Fix compiler warnings in Parser (#3908)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang authored Apr 26, 2024
1 parent b029e4f commit d857968
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Src/Base/Parser/AMReX_IParser_Exe.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <AMReX_IParser_Y.H>
#include <AMReX_Vector.H>

#include <limits>

#ifndef AMREX_IPARSER_STACK_SIZE
#define AMREX_IPARSER_STACK_SIZE 16
#endif
Expand Down Expand Up @@ -239,6 +241,8 @@ struct IParserStack
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
int iparser_exe_eval (const char* p, int const* x)
{
if (p == nullptr) { return std::numeric_limits<int>::max(); }

IParserStack<AMREX_IPARSER_STACK_SIZE> pstack;
while (*((iparser_exe_t*)p) != IPARSER_EXE_NULL) {
switch (*((iparser_exe_t*)p))
Expand Down
4 changes: 4 additions & 0 deletions Src/Base/Parser/AMReX_Parser_Exe.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <AMReX_Parser_Y.H>
#include <AMReX_Vector.H>

#include <limits>

#ifndef AMREX_PARSER_STACK_SIZE
#define AMREX_PARSER_STACK_SIZE 16
#endif
Expand Down Expand Up @@ -230,6 +232,8 @@ struct ParserStack
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
double parser_exe_eval (const char* p, double const* x)
{
if (p == nullptr) { return std::numeric_limits<double>::max(); }

ParserStack<AMREX_PARSER_STACK_SIZE> pstack;
while (*((parser_exe_t*)p) != PARSER_EXE_NULL) { // NOLINT
switch (*((parser_exe_t*)p))
Expand Down

0 comments on commit d857968

Please sign in to comment.