简体   繁体   中英

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. It doesn't look very logical.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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