Skip to content

Commit 79b64ec

Browse files
committed
Fix -Wswitch warning in c_cxx
+ constexpr, replace fallthrough with break
1 parent 9422f41 commit 79b64ec

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/gpre/c_cxx.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,16 @@ static void t_start_auto(const act*, const gpre_req*, const TEXT*, int, bool);
132132
static bool global_first_flag = false;
133133
static const TEXT* global_status_name = 0;
134134

135-
const int INDENT = 3;
135+
constexpr int INDENT = 3;
136136

137-
static const char* const NULL_STRING = "(char*) 0";
138-
static const char* const NULL_STATUS = "NULL";
139-
static const char* const NULL_SQLDA = "NULL";
137+
static constexpr const char* NULL_STRING = "(char*) 0";
138+
static constexpr const char* NULL_STATUS = "NULL";
139+
static constexpr const char* NULL_SQLDA = "NULL";
140140

141-
static const char* const GDS_INCLUDE = "<ibase.h>";
141+
static constexpr const char* GDS_INCLUDE = "<ibase.h>";
142142

143-
static const char* const DCL_LONG = "ISC_LONG";
144-
static const char* const DCL_QUAD = "ISC_QUAD";
143+
static constexpr const char* DCL_LONG = "ISC_LONG";
144+
static constexpr const char* DCL_QUAD = "ISC_QUAD";
145145

146146
static inline void begin(const int column)
147147
{
@@ -239,6 +239,7 @@ void C_CXX_action(const act* action, int column)
239239
case ACT_update:
240240
case ACT_statistics:
241241
begin(column);
242+
break;
242243

243244
default:
244245
break;
@@ -2853,6 +2854,9 @@ static void gen_request(const gpre_req* request)
28532854
string_type = "sdl";
28542855
is_blr = false;
28552856
break;
2857+
2858+
default:
2859+
break;
28562860
}
28572861

28582862
if (is_blr)

0 commit comments

Comments
 (0)