Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cast from void* to epicsUInt32 loses precision #3

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

tboegi
Copy link
Contributor

@tboegi tboegi commented Mar 11, 2020

Fix the compiler error on Windows64:
cast from ‘void*’ to ‘epicsUInt32 {aka unsigned int}’ loses precision

Introduce epicsUInt64 in the same way that asyn does it and use it
to look at the low-bits of address-pointers.

@kmpeters
Copy link
Contributor

Some of the code added to motorOmsCom.h looks like it isn't needed. motorOmsCom.h includes motordrvCom.h, which includes motor.h which includes these lines:

https://github.com/epics-modules/motor/blob/855c2540d1b2bd24a9ad2abc72c3f8473d8fa968/motorApp/MotorSrc/motor.h#L66-L70

@tboegi
Copy link
Contributor Author

tboegi commented Mar 17, 2020

Thanks @kmpeters ; work ongoing with a new patch

@tboegi
Copy link
Contributor Author

tboegi commented Mar 17, 2020

Öhhm, removing the "possibly duplicated definition" gives problems
when compiling Base 3.14.12

../drvOms.cc: In function ‘RTN_STATUS omsSetup(int, void*, unsigned int, int, int)’:
../drvOms.cc:1035:10: error: ‘epicsUInt64’ was not declared in this scope
if ((epicsUInt64) addrs & 0xF)
^
../drvOms.cc:1035:23: error: expected ‘)’ before ‘addrs’
if ((epicsUInt64) addrs & 0xF)

https://travis-ci.org/github/tboegi/motor/builds/663496630?utm_medium=notification&utm_source=email

@kmpeters
Copy link
Contributor

Is that because these lines were removed too?

#if LT_EPICSBASE(3,15,0,2)
#if __STDC_VERSION__ < 199901L
typedef long long epicsInt64;
typedef unsigned long long epicsUInt64;
#endif
#endif

Those do not appear in motor.h

Fix the compiler error on Windows64:
cast from ‘void*’ to ‘epicsUInt32 {aka unsigned int}’ loses precision

Introduce epicsUInt64 in the same way that asyn does it and use it
to look at the low-bits of address-pointers.
@tboegi tboegi force-pushed the 200311-Oms-pointer-cast-error branch from bb89068 to b32f201 Compare March 17, 2020 15:53
@tboegi
Copy link
Contributor Author

tboegi commented Mar 17, 2020

Now there is a new version pushed;
Probably the version that I should have done from the beginning

@kmpeters kmpeters merged commit e41f627 into master Mar 17, 2020
@kmpeters kmpeters deleted the 200311-Oms-pointer-cast-error branch March 17, 2020 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants