Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit c1be198

Browse files
t-bIngvord
authored andcommitted
Attribute: Don't treat an integer as an char* (#403)
Currently the compiler outputs attrgetsetprop.cpp: In member function ‘void Tango::Attribute::get_properties(Tango::AttributeConfig_3&)’: attrgetsetprop.cpp:200:91: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] conf.event_prop.per_event.period = CORBA::string_dup((const char *)(DEFAULT_EVENT_PERIOD)); and that is justified as DEFAULT_EVENT_PERIOD is an integer. Using the plain output operator into the stream is the preferred way.
1 parent 58e4f9c commit c1be198

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/server/attrgetsetprop.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,16 @@ void Attribute::get_properties(Tango::AttributeConfig_3 &conf)
195195
str.precision(TANGO_FLOAT_PRECISION);
196196

197197
if (event_period == INT_MAX)
198-
conf.event_prop.per_event.period = Tango::string_dup((const char *)(DEFAULT_EVENT_PERIOD));
198+
{
199+
str << DEFAULT_EVENT_PERIOD;
200+
}
199201
else
200202
{
201203
str << event_period;
202-
MEM_STREAM_2_CORBA(conf.event_prop.per_event.period,str);
203204
}
204205

206+
MEM_STREAM_2_CORBA(conf.event_prop.per_event.period,str);
207+
205208
//
206209
// Copy change event properties
207210
//

0 commit comments

Comments
 (0)