Skip to content

Commit b341703

Browse files
committed
Fix -Wparentheses warnings in gpre/obj_cxx
+ constexpr
1 parent 98e7a4f commit b341703

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/gpre/obj_cxx.cpp

Lines changed: 15 additions & 11 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 = "NULL";
138-
static const char* const NULL_STATUS = "NULL";
139-
static const char* const NULL_SQLDA = "NULL";
137+
static constexpr const char* NULL_STRING = "NULL";
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
{
@@ -251,6 +251,10 @@ void OBJ_CXX_action(const act* action, int column)
251251
case ACT_update:
252252
case ACT_statistics:
253253
begin(column);
254+
break;
255+
default:
256+
// no leading brace needed
257+
break;
254258
}
255259

256260
switch (action->act_type)
@@ -666,7 +670,7 @@ static void asgn_to( const act* action, ref* reference, int column)
666670

667671
// Pick up NULL value if one is there
668672

669-
if (reference = reference->ref_null)
673+
if ((reference = reference->ref_null))
670674
{
671675
align(column);
672676
fprintf(gpreGlob.out_file, "%s = %s;", reference->ref_value,
@@ -695,7 +699,7 @@ static void asgn_to( const act* action, ref* reference, int column)
695699

696700
// Pick up NULL value if one is there
697701

698-
if (reference = reference->ref_null)
702+
if ((reference = reference->ref_null))
699703
{
700704
align(column);
701705
fprintf(gpreGlob.out_file, "%s = %s;", reference->ref_value, gen_name(s, reference, true));
@@ -1057,7 +1061,7 @@ static void gen_blob_open( const act* action, USHORT column)
10571061
fprintf(gpreGlob.out_file, "%s = %s;", s, reference->ref_value);
10581062
}
10591063

1060-
if (args.pat_value1 = blob->blb_bpb_length)
1064+
if ((args.pat_value1 = blob->blb_bpb_length))
10611065
PATTERN_expand(column, pattern1, &args);
10621066
else
10631067
PATTERN_expand(column, pattern2, &args);
@@ -3364,7 +3368,7 @@ static void gen_t_start( const act* action, int column)
33643368

33653369
if (trans->tra_db_count == 1)
33663370
{
3367-
printa(column, "%s = %s->startTransaction(%s, %d, fb_tpb_%d);",
3371+
` printa(column, "%s = %s->startTransaction(%s, %d, fb_tpb_%d);",
33683372
trans->tra_handle ? trans->tra_handle : gpreGlob.transaction_name,
33693373
trans->tra_tpb->tpb_database->dbb_name->sym_string, vector,
33703374
trans->tra_tpb->tpb_length, trans->tra_tpb->tpb_ident);

0 commit comments

Comments
 (0)