With a VC++ project I have a line:
FXint realIndex = (int)m_cmbDevice->getItemData(indx);
This reads a void pointer value from combo box to an int value. In VC++ it compiles and works well. Now I have to port this to Linux and there I get a compile error
cpp:514:20: error:
cast from pointer to smaller type 'int' loses information
FXint realIndex = (int)m_cmbDevice->getItemData(indx);
Now I use
std::size_t x = reinterpret_cast<std::size_t>(m_cmbDevice->getItemData(indx));
FXint realIndex = x;
My question is now, is this the right way to go?