Skip to content

Commit a579eb7

Browse files
authored
Merge pull request #2364 from mitza-oci/a6t2-tao_idl-warnings
[ACE 6_TAO 2] fixed warnings
2 parents 3b06968 + 201b036 commit a579eb7

21 files changed

Lines changed: 1144 additions & 1131 deletions

File tree

ACE/ACEXML/common/HttpCharStream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ ACEXML_HttpCharStream::determine_encoding (void)
346346

347347
size_t i = 0;
348348
for (; i < len && input[i] != static_cast<char> (EOF); ++i)
349-
input[i] = this->stream_->peek_char (i);
349+
input[i] = static_cast<char> (this->stream_->peek_char (i));
350350

351351
if (i < len)
352352
return -1;

ACE/ACEXML/common/Transcode.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ ACEXML_Transcoder::utf162utf8 (ACEXML_UTF16 src,
4040
if (src >= 0xD800 && src < 0xE000)
4141
return ACEXML_IS_SURROGATE;
4242

43-
*dst = 0xe0 | (static_cast<ACEXML_UTF8> (src) / 0x1000);
44-
*(dst+1) = 0x80 | ((static_cast<ACEXML_UTF8> (src) % 0x1000) / 0x40);
45-
*(dst+2) = 0x80 | (static_cast<ACEXML_UTF8> (src) % 0x40);
43+
*dst = static_cast<ACEXML_UTF8> (0xe0 | (src / 0x1000));
44+
*(dst+1) = static_cast<ACEXML_UTF8> (0x80 | (src % 0x1000 / 0x40));
45+
*(dst+2) = static_cast<ACEXML_UTF8> (0x80 | (src % 0x40));
4646
return 3;
4747
}
4848
}
@@ -67,10 +67,10 @@ ACEXML_Transcoder::ucs42utf8 (ACEXML_UCS4 src,
6767
if (dst == 0)
6868
return ACEXML_INVALID_ARGS;
6969

70-
*dst = 0xf0 | (static_cast<ACEXML_UTF8> (src / 0x40000));
71-
*(dst+1) = 0x80 | ((static_cast<ACEXML_UTF8> (src % 0x40000)) / 0x1000);
72-
*(dst+2) = 0x80 | ((static_cast<ACEXML_UTF8> (src % 0x1000)) / 0x40);
73-
*(dst+3) = 0x80 | (static_cast<ACEXML_UTF8> (src % 0x40));
70+
*dst = static_cast<ACEXML_UTF8> (0xf0 | (src / 0x40000));
71+
*(dst+1) = static_cast<ACEXML_UTF8> (0x80 | (src % 0x40000 / 0x1000));
72+
*(dst+2) = static_cast<ACEXML_UTF8> (0x80 | (src % 0x1000 / 0x40));
73+
*(dst+3) = static_cast<ACEXML_UTF8> (0x80 | (src % 0x40));
7474
return 4;
7575
}
7676
return ACEXML_NON_UNICODE;

TAO/TAO_IDL/be/be_codegen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,9 @@ TAO_CodeGen::start_anyop_header (const char *fname)
848848
{
849849
char* idl_name = idl_global->included_idl_files ()[j];
850850

851-
ACE_CString pidl_checker (idl_name);
851+
ACE_CString const pidl_checker_included (idl_name);
852852
bool const got_pidl =
853-
(pidl_checker.substr (pidl_checker.length () - 5) == ".pidl");
853+
(pidl_checker_included.substr (pidl_checker_included.length () - 5) == ".pidl");
854854

855855
// If we're here and we have a .pidl file, we need to generate
856856
// the *A.h include, if it is not a .pidl file we don't generate

TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,18 +528,18 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node)
528528
original_arg->direction () == AST_Argument::dir_INOUT)
529529
{
530530
// Create the argument.
531-
be_argument *arg = 0;
531+
be_argument *arg_new = 0;
532532
UTL_ScopedName *new_name =
533533
(UTL_ScopedName *)original_arg->name ()->copy ();
534-
ACE_NEW_RETURN (arg,
534+
ACE_NEW_RETURN (arg_new,
535535
be_argument (AST_Argument::dir_IN,
536536
original_arg->field_type (),
537537
new_name),
538538
0);
539539

540-
arg->set_defined_in (op);
541-
arg->set_name (new_name);
542-
op->be_add_argument (arg);
540+
arg_new->set_defined_in (op);
541+
arg_new->set_name (new_name);
542+
op->be_add_argument (arg_new);
543543
}
544544
} // end of while loop
545545
} // end of if

TAO/TAO_IDL/be/be_visitor_connector/executor_ami_exs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ be_visitor_executor_ami_exs::visit_connector (be_connector *node)
4949
i.next ())
5050
{
5151
AST_Decl *d = i.item ();
52-
AST_Provides *p = dynamic_cast<AST_Provides*> (d);
52+
AST_Provides *const provides = dynamic_cast<AST_Provides*> (d);
5353

54-
if (p != 0)
54+
if (provides)
5555
{
5656
if (first)
5757
{
5858
os_ << ": facet_exec_" << port_nr << "_ (new ";
59-
os_ << p->provides_type ()->local_name ();
59+
os_ << provides->provides_type ()->local_name ();
6060
os_ << suffix << " ())" << be_nl;
6161
first = false;
6262
}
6363
else
6464
{
6565
os_ << ", facet_exec_" << port_nr << "_ (new ";
66-
os_ << p->provides_type ()->local_name ();
66+
os_ << provides->provides_type ()->local_name ();
6767
os_ << suffix << " ())" << be_uidt_nl;
6868
}
6969
port_nr++;

TAO/TAO_IDL/be/be_visitor_constant/constant.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,4 @@ const char *exprtype_to_cpp_corba_type (AST_Expression::ExprType et)
4545
default:
4646
return 0;
4747
}
48-
49-
return 0;
5048
}

TAO/TAO_IDL/be/be_visitor_interface/facet_svts.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */,
140140
i.next ())
141141
{
142142
AST_Decl *d = i.item ();
143-
AST_Decl::NodeType nt = d->node_type ();
144143

145-
switch (nt)
144+
switch (d->node_type ())
146145
{
147146
case AST_Decl::NT_op:
148147
{

TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ be_visitor_native_ch::visit_native (be_native *node)
6666
// DDS/DCPS zero-copy read sequence type support.
6767

6868
// strip the "Seq" ending to get the sample's name
69-
const char * node_name = node->full_name ();
7069
const size_t max_name_length = 2000;
7170
const size_t node_name_length = ACE_OS::strlen (node_name);
7271
if (node_name_length >= max_name_length ||

TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,13 @@ be_visitor_typedef_ch::visit_array (be_array *node)
201201
// we can have only one call to it from any instantiation per stream
202202
// output statement.
203203

204-
const char *static_decl = "";
205-
AST_Module *scope = dynamic_cast<AST_Module*> (tdef->defined_in ());
204+
AST_Module *tdef_scope = dynamic_cast<AST_Module *> (tdef->defined_in ());
206205

207206
// If the typedef is not declared globally or in a module, the
208207
// associated array memory management function must be static.
209-
if (scope == 0)
210-
{
211-
static_decl = "static ";
212-
}
208+
char const *const static_decl = tdef_scope ? "" : "static ";
213209

214-
const char *td_name = tdef->nested_type_name (scope);
210+
char const *td_name = tdef->nested_type_name (tdef_scope);
215211

216212
// If the array and the typedef are both declared inside
217213
// an interface or valuetype, for example, nested_type_name()

TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node)
364364
// Step last: generate typecode declaration.
365365
if (be_global->tc_support ())
366366
{
367-
be_visitor_context ctx (*this->ctx_);
368-
be_visitor_typecode_decl visitor (&ctx);
367+
be_visitor_context tc_ctx (*this->ctx_);
368+
be_visitor_typecode_decl tc_visitor (&tc_ctx);
369369

370-
if (node->accept (&visitor) == -1)
370+
if (node->accept (&tc_visitor) == -1)
371371
{
372372
ACE_ERROR_RETURN ((LM_ERROR,
373373
ACE_TEXT ("be_visitor_valuetype_ch::")

0 commit comments

Comments
 (0)