简体   繁体   English

表达结果未使用

[英]Expression result unused

I got some codes and I'm trying to fix some compiling bugs: 我有一些代码,我正在尝试修复一些编译错误:

StkFrames& PRCRev :: tick( StkFrames& frames, unsigned int channel )
{
#if defined(_STK_DEBUG_)
  if ( channel >= frames.channels() - 1 ) {
    errorString_ << "PRCRev::tick(): channel and StkFrames arguments are incompatible!";
    handleError( StkError::FUNCTION_ARGUMENT );
  }
#endif

  StkFloat *samples = &frames[channel];
  unsigned int hop = frames.channels();
  for ( unsigned int i=0; i<frames.frames(); i++, samples += hop ) {
    *samples = tick( *samples );

    *samples++; <<<<<<<<<--------- Expression result unused.

    *samples = lastFrame_[1];
  }

  return frames;
}

I don't understand what the codes is trying to do. 我不明白这些代码正在尝试做什么。 The codes are huge and I fixed quite a few. 代码很大,我修复了很多。 But googling didn't work for this. 但是,谷歌搜索对此不起作用。

Any ideas? 有任何想法吗?

First, you do an increment (the line which actually gives you warning). 首先,您进行增量操作(实际上会向您发出警告的行)。

*samples++;

And then you assign to that variable something else, which makes previous action unused. 然后,您为该变量分配其他内容,从而使先前的操作未使用。

*samples = lastFrame_[1];

I recommend you to read this code inside 'for' loop more carefully. 我建议您更仔细地在“ for”循环中阅读此代码。 It doesn't look very logical. 看起来不太合逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM