nsCRT::memcpy(temporaryRowHolder, (void *) &aInitialBuffer[currentRow], numBytesPerRow); nsCRT::memcpy((void *) &aInitialBuffer[currentRow], (void *)&aInitialBuffer[lastRow], numBytesPerRow); nsCRT::memcpy((void *) &aInitialBuffer[lastRow], temporaryRowHolder, numBytesPerRow);
memcpy(temporaryRowHolder, (void *) &aInitialBuffer[currentRow], numBytesPerRow); memcpy((void *) &aInitialBuffer[currentRow], (void *)&aInitialBuffer[lastRow], numBytesPerRow); memcpy((void *) &aInitialBuffer[lastRow], temporaryRowHolder, numBytesPerRow);
void InvertRows(unsigned char * aInitialBuffer, PRUint32 sizeOfBuffer, PRUint32 numBytesPerRow){  if (!numBytesPerRow) return;   PRUint32 numRows = sizeOfBuffer / numBytesPerRow;  void * temporaryRowHolder = (void *) nsMemory::Alloc(numBytesPerRow);  PRUint32 currentRow = 0;  PRUint32 lastRow = (numRows - 1) * numBytesPerRow;  while (currentRow < lastRow)  {    // store the current row into a temporary buffer    nsCRT::memcpy(temporaryRowHolder, (void *) &aInitialBuffer[currentRow], numBytesPerRow);    nsCRT::memcpy((void *) &aInitialBuffer[currentRow], (void *)&aInitialBuffer[lastRow], numBytesPerRow);    nsCRT::memcpy((void *) &aInitialBuffer[lastRow], temporaryRowHolder, numBytesPerRow);    lastRow -= numBytesPerRow;    currentRow += numBytesPerRow;  }  nsMemory::Free(temporaryRowHolder);}