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 Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by