how to resolve the following cast errors?
Show older comments
Error using mex
In file included from
/home/proj/elendil/peimin/Matlab_Simulink_Models/trunk/Adaptrum_Matlab_FuncLib/Viterbi/cpp_files/scanning_bit_comparator.cpp:139:0:
/home/proj/elendil/peimin/Matlab_Simulink_Models/trunk/Adaptrum_Matlab_FuncLib/Viterbi/cpp_files/errdet.cpp: In member function ?bool
ErrorDetector::scan()?:
/home/proj/elendil/peimin/Matlab_Simulink_Models/trunk/Adaptrum_Matlab_FuncLib/Viterbi/cpp_files/errdet.cpp:24:49: error: cast from
?void*? to ?unsigned int? loses precision [-fpermissive]
unsigned txBit = (unsigned) (txData->peek(i));
^
/home/proj/elendil/peimin/Matlab_Simulink_Models/trunk/Adaptrum_Matlab_FuncLib/Viterbi/cpp_files/errdet.cpp:25:49: error: cast from
?void*? to ?unsigned int? loses precision [-fpermissive]
unsigned rxBit = (unsigned) (rxData->peek(i));
^
/home/proj/elendil/peimin/Matlab_Simulink_Models/trunk/Adaptrum_Matlab_FuncLib/Viterbi/cpp_files/errdet.cpp: In member function
?ErrorDetectorState ErrorDetector::advance(unsigned int, unsigned int, unsigned int*)?:
/home/proj/elendil/peimin/Matlab_Simulink_Models/trunk/Adaptrum_Matlab_FuncLib/Viterbi/cpp_files/errdet.cpp:40:29: warning: cast to
pointer from integer of different size [-Wint-to-pointer-cast]
txData->append((void *) txBit);
^
1 Comment
Walter Roberson
on 2 May 2016
On the target machine, what is the size of an unsigned int, and what is the size of a pointer?
Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!