how to resolve the following cast errors?

조회 수: 2 (최근 30일)
harrison kuo
harrison kuo 2016년 5월 2일
댓글: Walter Roberson 2016년 5월 2일
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
Walter Roberson
Walter Roberson 2016년 5월 2일
On the target machine, what is the size of an unsigned int, and what is the size of a pointer?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by