Python中关于“warning: Debugger speedups using cython not found”问题的解决

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。


1. 打开终端:找到“Pycharm/pycharm-community-2016.2.2/helpers/pydev”完整路径,然后cd到那里,比如我的是:“cd madd/soft/Pycharm/pycharm-community-2016.2.2/helpers/pydev”;

2. 输入:“python build_ext --inplace”,回车;




解决PCLint warning问题


#define CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual,delta) \rn double expectedVal=expected; \rn double actualVal=actual; \rn double deltaVal=delta; \rn double diffVal=fabs((expectedVal)-(actualVal)); \rn if((diffVal)<(deltaVal)) \rn PRINT_OUT("Values - Expected: " #expected " - Actual: " #actual " - Delta: " #delta); \rn else \rn CPPUNIT_NS::assertDoubleEquals( (expectedVal), \rn (actualVal), \rn (deltaVal), \rn CPPUNIT_SOURCELINE(), \rn "" ); \rn \rnrnrn请问这段代码有什么问题? 为什么用PCLint检查出来有 rnWarning 665: (Warning -- Unparenthesized parameter 1 in macro 'CPPUNIT_ASSERT_DOUBLES_EQUAL' is passed an expression)rn的警告?rnrn以下是关于此警告的解释:rn665 Unparenthesized parameter Integer in macro 'Symbol' is passed an expressionrn-- An expression was passed to a macro parameter that was not parenthesized. For example:rn#define mult(a,b) (a*b)rn... mult( 100, 4 + 10 )rnHere the programmer is beguiled into thinking that the 4+10 is taken as a quantity to be multipliedrnby 100 but instead results in: 100*4+10, which is quite different. The recommended remedyrn([22 section 20.4]) is to parenthesize such parameters as in:rn#define mult(a,b) ((a)*(b))rnrnThe message is not arbitrarily given for any unparenthesized parameter but only when the actualrnmacro argument sufficiently resembles an expression and the expression involves binary operators.rnThe priority of the operator is not considered except that it must have lower priority thanrnthe unary operators. The message is not issued at the point of macro definition because it mayrnnot be appropriate to parenthesize the parameter. For example, the following macro expects thatrnan operator will be passed as argument. It would be an error to enclose op in parentheses.rn#define check(x,op,y) if( ((x) op (y)) == 0 ) print( ... )rnrn我的代码有此类问题吗? 论坛

关于一个Warning问题 .有谁能解决 ~~~~~~~~~~~~~~


我编写了一个关于com的测试程式.rn设定rnrn一 In process DLLrn二 Support MFC rn三 Connection Point rnrn问题:rn一 我的关于Events 的定义rn [id(1), helpstring("method OnReceive")] HRESULT OnReceive(VARIANT * buf);rn二 wizard 生成的代码:rn HRESULT Fire_OnReceive(VARIANT * buf)rn rn CComVariant varResult;rn T* pT = static_cast(this);rn int nConnectionIndex;rn CComVariant* pvars = new CComVariant[1];rn int nConnections = m_vec.GetSize();rn rn for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)rn rn pT->Lock();rn CComPtr sp = m_vec.GetAt(nConnectionIndex);rn pT->Unlock();rn IDispatch* pDispatch = reinterpret_cast(sp.p);rn if (pDispatch != NULL)rn rn VariantClear(&varResult);rn pvars[0] = buf; // 警告在这里rn DISPPARAMS disp = pvars, NULL, 1, 0 ;rn pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);rn rn rn delete[] pvars;rn return varResult.scode;rn rn rn三 .问题rn如果我要调用Fire_OnReceive的时候就会出现如下的警告rnf:\victor\磁盘文档\downloads\vc\exsample for vc\testpro1\testpro1cp.h(26) : warning C4800: 'struct tagVARIANT *' : forcing value to bool 'true' or 'false' (performance warning)rn f:\victor\磁盘文档\downloads\vc\exsample for vc\testpro1\testpro1cp.h(10) : while compiling class-template member function 'long __thiscall CProxy_ITestEvents::Fire_OnReceive(struct tagVARIANT *)'rn结果我在使用com的时候在处理这个event的时候传进来的参数不是我要的却是一个boolean类型的值 .rnrnrnrn我很着急,希望高人给予指点 .rn 论坛