how to resolve the following cast errors?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 2 Mai 2016
On the target machine, what is the size of an unsigned int, and what is the size of a pointer?
Réponses (0)
Voir également
Catégories
En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!