~ubuntu-branches/ubuntu/vivid/unrar-nonfree/vivid

« back to all changes in this revision

Viewing changes to rarvm.cpp

  • Committer: Package Import Robot
  • Author(s): Martin Meredith
  • Date: 2015-02-03 12:58:01 UTC
  • mfrom: (1.1.18) (5.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20150203125801-od6ev8cqy1er51vz
Tags: 1:5.2.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
  }
45
45
  else
46
46
  {
47
 
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT)
 
47
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED)
48
48
    if (IS_VM_MEM(Addr))
49
49
    {
50
50
      byte *B=(byte *)Addr;
58
58
  }
59
59
}
60
60
 
61
 
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT)
 
61
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED)
62
62
  #define GET_VALUE(ByteMode,Addr) GetValue(ByteMode,(uint *)Addr)
63
63
#else
64
64
  #define GET_VALUE(ByteMode,Addr) ((ByteMode) ? (*(byte *)(Addr)):GET_UINT32(*(uint *)(Addr)))
80
80
  }
81
81
  else
82
82
  {
83
 
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) || !defined(PRESENT_INT32)
 
83
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
84
84
    if (IS_VM_MEM(Addr))
85
85
    {
86
86
      ((byte *)Addr)[0]=(byte)Value;
96
96
  }
97
97
}
98
98
 
99
 
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) || !defined(PRESENT_INT32)
 
99
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
100
100
  #define SET_VALUE(ByteMode,Addr,Value) SetValue(ByteMode,(uint *)Addr,Value)
101
101
#else
102
102
  #define SET_VALUE(ByteMode,Addr,Value) ((ByteMode) ? (*(byte *)(Addr)=((byte)(Value))):(*(uint32 *)(Addr)=((uint32)(Value))))
105
105
 
106
106
void RarVM::SetLowEndianValue(uint *Addr,uint Value)
107
107
{
108
 
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) || !defined(PRESENT_INT32)
 
108
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
109
109
  ((byte *)Addr)[0]=(byte)Value;
110
110
  ((byte *)Addr)[1]=(byte)(Value>>8);
111
111
  ((byte *)Addr)[2]=(byte)(Value>>16);
984
984
        byte *SrcData=Mem,*DestData=SrcData+DataSize;
985
985
        const int Channels=3;
986
986
        SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
987
 
        if ((uint)DataSize>=VM_GLOBALMEMADDR/2 || PosR<0)
 
987
        if ((uint)DataSize>=VM_GLOBALMEMADDR/2 || Width<0 || PosR<0)
988
988
          break;
989
989
        for (int CurChannel=0;CurChannel<Channels;CurChannel++)
990
990
        {