how to resolve the following cast errors?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Walter Roberson
el 2 de Mayo de 2016
On the target machine, what is the size of an unsigned int, and what is the size of a pointer?
Respuestas (0)
Ver también
Categorías
Más información sobre Operators and Elementary Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!