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

Conversation

@Ingvord
Copy link
Member

@Ingvord Ingvord commented Dec 17, 2016

progress #339: pointer-cast-size-mismatch attrgetsetprop.cpp:200

@Ingvord Ingvord requested a review from bourtemb December 17, 2016 12:01
Copy link
Member

@bourtemb bourtemb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems fine to remove these casts.
The code used to be like the following in the Tango prehistory:
int per = (int)((double)ext->event_period / DELTA_PERIODIC);
It looks like the casts where not removed when the division was no longer needed.
It seems there is the same issue on line 268 with archive_period. Strange that there is no compilation warning. Line 268 should be fixed too.

{
int per = (int)((double)event_period);
int per = event_period;
str << per;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could even optimize by replacing lines 201 and 202 with:
str << event_period;

@Ingvord Ingvord merged commit e324ce4 into tango-controls:master Feb 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants