fix code that depends on GCC's void* pointer arithmetic extension
Modified: trunk/reactos/ntoskrnl/cc/copy.c
Modified: trunk/reactos/ntoskrnl/cc/pin.c
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
Modified: trunk/reactos/ntoskrnl/mm/region.c
Modified: trunk/reactos/subsys/csrss/win32csr/conio.c
Modified: trunk/reactos/subsys/csrss/win32csr/tuiconsole.c
Modified: trunk/reactos/subsys/system/usetup/cabinet.c
Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib1bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib24bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib4bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib8bpp.c
Modified: trunk/reactos/subsys/win32k/eng/bitblt.c
Modified: trunk/reactos/subsys/win32k/ldr/loader.c
Modified: trunk/reactos/subsys/win32k/ntuser/menu.c
_____
Modified: trunk/reactos/ntoskrnl/cc/copy.c
--- trunk/reactos/ntoskrnl/cc/copy.c 2005-07-05 00:24:36 UTC (rev
16420)
+++ trunk/reactos/ntoskrnl/cc/copy.c 2005-07-05 00:57:47 UTC (rev
16421)
@@ -89,15 +89,9 @@
{
TempLength = min(Bcb->CacheSegmentSize, Length);
memcpy(Buffer, current->BaseAddress, TempLength);
-#if defined(__GNUC__)
- Buffer += TempLength;
-#else
- {
- char* pTemp = Buffer;
- pTemp += TempLength;
- Buffer = pTemp;
- }
-#endif
+
+ Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength);
+
Length = Length - TempLength;
previous = current;
current = current->NextInChain;
@@ -180,15 +174,9 @@
current = current->NextInChain;
TempLength = min(Bcb->CacheSegmentSize, Length);
memcpy(Buffer, previous->BaseAddress, TempLength);
-#if defined(__GNUC__)
- Buffer += TempLength;
-#else
- {
- char* pTemp = Buffer;
- pTemp += TempLength;
- Buffer = pTemp;
- }
-#endif
+
+ Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength);
+
Length = Length - TempLength;
CcRosReleaseCacheSegment(Bcb, previous, TRUE, FALSE,
FALSE);
current_size += Bcb->CacheSegmentSize;
@@ -393,15 +381,8 @@
ReadLength += TempLength;
Length -= TempLength;
ReadOffset += TempLength;
-#if defined(__GNUC__)
- Buffer += TempLength;
-#else
- {
- char* pTemp = Buffer;
- pTemp += TempLength;
- Buffer = pTemp;
- }
-#endif
+
+ Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength);
}
IoStatus->Status = STATUS_SUCCESS;
IoStatus->Information = ReadLength;
@@ -488,15 +469,8 @@
Length -= TempLength;
WriteOffset += TempLength;
-#if defined(__GNUC__)
- Buffer += TempLength;
-#else
- {
- char* pTemp = Buffer;
- pTemp += TempLength;
- Buffer = pTemp;
- }
-#endif
+
+ Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength);
}
while (Length > 0)
@@ -520,15 +494,8 @@
CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, TRUE, FALSE);
Length -= TempLength;
WriteOffset += TempLength;
-#if defined(__GNUC__)
- Buffer += TempLength;
-#else
- {
- char* pTemp = Buffer;
- pTemp += TempLength;
- Buffer = pTemp;
- }
-#endif
+
+ Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength);
}
return(TRUE);
}
_____
Modified: trunk/reactos/ntoskrnl/cc/pin.c
--- trunk/reactos/ntoskrnl/cc/pin.c 2005-07-05 00:24:36 UTC (rev
16420)
+++ trunk/reactos/ntoskrnl/cc/pin.c 2005-07-05 00:57:47 UTC (rev
16421)
@@ -78,15 +78,8 @@
return(FALSE);
}
}
-#if defined(__GNUC__)
- *pBuffer += ReadOffset % Bcb->CacheSegmentSize;
-#else
- {
- char* pTemp = *pBuffer;
- pTemp += ReadOffset % Bcb->CacheSegmentSize;
- *pBuffer = pTemp;
- }
-#endif
+
+ *pBuffer = (PVOID)((ULONG_PTR)(*pBuffer) + (ReadOffset %
Bcb->CacheSegmentSize));
iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList);
if (iBcb == NULL)
{
_____
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
--- trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -729,7 +729,7 @@
}
StackBase = Frame;
- StackEnd = mbi.BaseAddress + mbi.RegionSize;
+ StackEnd = (PULONG)((ULONG_PTR)mbi.BaseAddress +
mbi.RegionSize);
while ( Frame >= StackBase && Frame < StackEnd )
{
@@ -786,7 +786,7 @@
}
StackBase = Frame;
- StackEnd = mbi.BaseAddress + mbi.RegionSize;
+ StackEnd = (PULONG)((ULONG_PTR)mbi.BaseAddress +
mbi.RegionSize);
while ( Frame >= StackBase && Frame < StackEnd && i++ <
FrameCount )
{
@@ -838,7 +838,7 @@
}
StackBase = Frame;
- StackEnd = mbi.BaseAddress + mbi.RegionSize;
+ StackEnd = (PULONG)((ULONG_PTR)mbi.BaseAddress +
mbi.RegionSize);
while ( Count < FrameCount && Frame >= StackBase &&
Frame < StackEnd )
{
_____
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
--- trunk/reactos/ntoskrnl/mm/i386/page.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -502,7 +502,7 @@
DPRINT("MmGetPageTableForProcessForPAE(%x %x %d)\n",
Process, Address, Create);
- if (Address >= (PVOID)PAGETABLE_MAP && Address <
(PVOID)PAGETABLE_MAP + 0x800000)
+ if (Address >= (PVOID)PAGETABLE_MAP && Address <
(PVOID)((ULONG_PTR)PAGETABLE_MAP + 0x800000))
{
KEBUGCHECK(0);
}
@@ -1500,7 +1500,7 @@
ULONGLONG Pte;
oldPdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr) + 1;
- for (i = 0; i < PageCount; i++, Addr += PAGE_SIZE)
+ for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr +
PAGE_SIZE))
{
if (!(Attributes & PA_PRESENT) && Pages[i] != 0)
{
@@ -1550,7 +1550,7 @@
}
Pt--;
- for (i = 0; i < PageCount; i++, Addr += PAGE_SIZE)
+ for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr +
PAGE_SIZE))
{
if (!(Attributes & PA_PRESENT) && Pages[i] != 0)
{
@@ -1746,7 +1746,7 @@
PULONGLONG Pt = NULL;
oldPdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr) + 1;
- for (i = 0; i < PageCount; i++, Addr += PAGE_SIZE)
+ for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr +
PAGE_SIZE))
{
if (!(Attributes & PA_PRESENT) && Pages[i] != 0)
{
@@ -1815,7 +1815,7 @@
PULONG Pt = NULL;
ULONG Pte;
oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr) + 1;
- for (i = 0; i < PageCount; i++, Addr += PAGE_SIZE)
+ for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr +
PAGE_SIZE))
{
if (!(Attributes & PA_PRESENT) && Pages[i] != 0)
{
@@ -2182,7 +2182,7 @@
}
}
}
- Address = (PVOID)HYPERSPACE + i * PAGE_SIZE;
+ Address = (PVOID)((ULONG_PTR)HYPERSPACE + i * PAGE_SIZE);
FLUSH_TLB_ONE(Address);
return Address;
}
@@ -2244,7 +2244,7 @@
ULONGLONG ZeroPde = 0LL;
ULONG i;
- for (i = PAE_ADDR_TO_PDTE_OFFSET(Address); i <=
PAE_ADDR_TO_PDTE_OFFSET(Address + Size); i++)
+ for (i = PAE_ADDR_TO_PDTE_OFFSET(Address); i <=
PAE_ADDR_TO_PDTE_OFFSET((PVOID)((ULONG_PTR)Address + Size)); i++)
{
if (i == PAE_ADDR_TO_PDTE_OFFSET(Address))
{
@@ -2254,9 +2254,9 @@
{
StartOffset = 0;
}
- if (i == PAE_ADDR_TO_PDTE_OFFSET(Address + Size))
+ if (i == PAE_ADDR_TO_PDTE_OFFSET((PVOID)((ULONG_PTR)Address +
Size)))
{
- EndOffset = PAE_ADDR_TO_PDE_PAGE_OFFSET(Address + Size);
+ EndOffset =
PAE_ADDR_TO_PDE_PAGE_OFFSET((PVOID)((ULONG_PTR)Address + Size));
}
else
{
@@ -2288,7 +2288,7 @@
{
PULONG Pde;
StartOffset = ADDR_TO_PDE_OFFSET(Address);
- EndOffset = ADDR_TO_PDE_OFFSET(Address + Size);
+ EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address +
Size));
if (Process != NULL && Process != PsGetCurrentProcess())
{
_____
Modified: trunk/reactos/ntoskrnl/mm/region.c
--- trunk/reactos/ntoskrnl/mm/region.c 2005-07-05 00:24:36 UTC (rev
16420)
+++ trunk/reactos/ntoskrnl/mm/region.c 2005-07-05 00:57:47 UTC (rev
16421)
@@ -170,16 +170,8 @@
CurrentRegion->Type, CurrentRegion->Protect,
NewType, NewProtect);
}
-#if defined(__GNUC__)
- CurrentBaseAddress += CurrentRegion->Length;
-#else
- {
- char* pTemp = CurrentBaseAddress;
- pTemp += CurrentRegion->Length;
- CurrentBaseAddress = pTemp;
- }
-#endif
+ CurrentBaseAddress = (PVOID)((ULONG_PTR)CurrentBaseAddress +
CurrentRegion->Length);
NewRegion->Length += CurrentRegion->Length;
RemainingLength -= CurrentRegion->Length;
CurrentEntry = CurrentEntry->Flink;
@@ -283,18 +275,9 @@
}
current_entry = current_entry->Flink;
-#if defined(__GNUC__)
- StartAddress += current->Length;
-#else
+ StartAddress = (PVOID)((ULONG_PTR)StartAddress +
current->Length);
- {
- char* pTemp = StartAddress;
- pTemp += current->Length;
- StartAddress = pTemp;
- }
-#endif
-
}
return(NULL);
}
_____
Modified: trunk/reactos/subsys/csrss/win32csr/conio.c
--- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -2273,8 +2273,8 @@
BufferCoord = Request->Data.WriteConsoleOutputRequest.BufferCoord;
CharInfo = Request->Data.WriteConsoleOutputRequest.CharInfo;
if (((PVOID)CharInfo < ProcessData->CsrSectionViewBase) ||
- (((PVOID)CharInfo + PSize) >
- (ProcessData->CsrSectionViewBase +
ProcessData->CsrSectionViewSize)))
+ (((ULONG_PTR)CharInfo + PSize) >
+ ((ULONG_PTR)ProcessData->CsrSectionViewBase +
ProcessData->CsrSectionViewSize)))
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
@@ -2690,7 +2690,7 @@
Size = Length * sizeof(INPUT_RECORD);
if (((PVOID)InputRecord < ProcessData->CsrSectionViewBase)
- || (((PVOID)InputRecord + Size) >
(ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
+ || (((ULONG_PTR)InputRecord + Size) >
((ULONG_PTR)ProcessData->CsrSectionViewBase +
ProcessData->CsrSectionViewSize)))
{
ConioUnlockConsole(Console);
Request->Status = STATUS_ACCESS_VIOLATION;
@@ -2776,7 +2776,7 @@
CodePage = ProcessData->Console->OutputCodePage;
if (((PVOID)CharInfo < ProcessData->CsrSectionViewBase)
- || (((PVOID)CharInfo + Size) > (ProcessData->CsrSectionViewBase +
ProcessData->CsrSectionViewSize)))
+ || (((ULONG_PTR)CharInfo + Size) >
((ULONG_PTR)ProcessData->CsrSectionViewBase +
ProcessData->CsrSectionViewSize)))
{
ConioUnlockScreenBuffer(Buff);
Request->Status = STATUS_ACCESS_VIOLATION;
@@ -2856,7 +2856,7 @@
Size = Length * sizeof(INPUT_RECORD);
if (((PVOID)InputRecord < ProcessData->CsrSectionViewBase)
- || (((PVOID)InputRecord + Size) >
(ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
+ || (((ULONG_PTR)InputRecord + Size) >
((ULONG_PTR)ProcessData->CsrSectionViewBase +
ProcessData->CsrSectionViewSize)))
{
ConioUnlockConsole(Console);
Request->Status = STATUS_ACCESS_VIOLATION;
_____
Modified: trunk/reactos/subsys/csrss/win32csr/tuiconsole.c
--- trunk/reactos/subsys/csrss/win32csr/tuiconsole.c 2005-07-05
00:24:36 UTC (rev 16420)
+++ trunk/reactos/subsys/csrss/win32csr/tuiconsole.c 2005-07-05
00:57:47 UTC (rev 16421)
@@ -293,7 +293,7 @@
0,
sizeof(COORD) + Title.MaximumLength);
pos = (COORD *)Buffer;
- Title.Buffer = Buffer + sizeof( COORD );
+ Title.Buffer = (PVOID)((ULONG_PTR)Buffer + sizeof( COORD ));
RtlUnicodeStringToAnsiString(&Title, &SwapConsole->Title, FALSE);
pos->Y = PhysicalConsoleSize.Y / 2;
_____
Modified: trunk/reactos/subsys/system/usetup/cabinet.c
--- trunk/reactos/subsys/system/usetup/cabinet.c 2005-07-05
00:24:36 UTC (rev 16420)
+++ trunk/reactos/subsys/system/usetup/cabinet.c 2005-07-05
00:57:47 UTC (rev 16421)
@@ -1033,7 +1033,7 @@
Status = CAB_STATUS_INVALID_CAB;
goto UnmapDestFile;
}
- CurrentDestBuffer += OutputLength; // advance dest buffer by
bytes produced
+ CurrentDestBuffer = (PVOID)((ULONG_PTR)CurrentDestBuffer +
OutputLength); // advance dest buffer by bytes produced
CurrentBuffer += InputLength; // advance src buffer by
bytes consumed
Size -= OutputLength; // reduce remaining file
bytes by bytes produced
RemainingBlock -= InputLength; // reduce remaining block
size by bytes consumed
_____
Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c
--- trunk/reactos/subsys/win32k/dib/dib16bpp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/win32k/dib/dib16bpp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -26,7 +26,7 @@
VOID
DIB_16BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
PWORD addr = (PWORD)byteaddr + x;
*addr = (WORD)c;
@@ -35,7 +35,7 @@
ULONG
DIB_16BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
PWORD addr = (PWORD)byteaddr + x;
return (ULONG)(*addr);
@@ -44,7 +44,7 @@
VOID
DIB_16BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
- PDWORD addr = (PDWORD)((PWORD)(SurfObj->pvScan0 + y *
SurfObj->lDelta) + x1);
+ PDWORD addr = (PDWORD)((PWORD)((PBYTE)SurfObj->pvScan0 + y *
SurfObj->lDelta) + x1);
#ifdef _M_IX86
@@ -126,7 +126,7 @@
" jnz 1b" "\n\t"
"2:" "\n\t"
: /* no output */
- : "r"(SurfObj->pvScan0 + (y1 * SurfObj->lDelta) + (x * sizeof
(WORD))),
+ : "r"((PBYTE)SurfObj->pvScan0 + (y1 * SurfObj->lDelta) + (x *
sizeof (WORD))),
"r"(SurfObj->lDelta), "r"(y2 - y1), "a"(c)
: "cc", "memory", "%ecx");
#else
@@ -150,7 +150,7 @@
LONG i, j, sx, sy, xColor, f1;
PBYTE SourceBits, DestBits, SourceLine, DestLine;
PBYTE SourceBits_4BPP, SourceLine_4BPP;
- DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta) + 2 * BltInfo->DestRect.left;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + 2 *
BltInfo->DestRect.left;
switch(BltInfo->SourceSurface->iBitmapFormat)
{
@@ -176,7 +176,7 @@
break;
case BMF_4BPP:
- SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
(BltInfo->SourcePoint.x >> 1);
+ SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
(BltInfo->SourcePoint.x >> 1);
for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{
@@ -198,7 +198,7 @@
break;
case BMF_8BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -223,7 +223,7 @@
{
if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
for (j = BltInfo->DestRect.top; j <
BltInfo->DestRect.bottom; j++)
{
RtlMoveMemory(DestBits, SourceBits, 2 *
(BltInfo->DestRect.right - BltInfo->DestRect.left));
@@ -233,8 +233,8 @@
}
else
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
- DestBits = BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 2 *
BltInfo->DestRect.left;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 2 *
BltInfo->DestRect.left;
for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top
<= j; j--)
{
RtlMoveMemory(DestBits, SourceBits, 2 *
(BltInfo->DestRect.right - BltInfo->DestRect.left));
@@ -247,7 +247,7 @@
{
if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j <
BltInfo->DestRect.bottom; j++)
{
@@ -265,8 +265,8 @@
}
else
{
- SourceLine = BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
- DestLine = BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 2 *
BltInfo->DestRect.left;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ DestLine = (PBYTE)BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 2 *
BltInfo->DestRect.left;
for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top
<= j; j--)
{
SourceBits = SourceLine;
@@ -285,7 +285,7 @@
break;
case BMF_24BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -309,7 +309,7 @@
break;
case BMF_32BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -356,7 +356,7 @@
((BltInfo->DestRect.right - BltInfo->DestRect.left) &
0x1);
SourceY = BltInfo->SourcePoint.y;
DestBits = (PULONG)(
- BltInfo->DestSurface->pvScan0 +
+ (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 1) +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
@@ -440,7 +440,7 @@
/* This is about 10% faster than the generic C code below */
ULONG delta = DestSurface->lDelta;
ULONG width = (DestRect->right - DestRect->left) ;
- PULONG pos = (PULONG) (DestSurface->pvScan0 + DestRect->top * delta
+ (DestRect->left<<1));
+ PULONG pos = (PULONG) ((PBYTE)DestSurface->pvScan0 + DestRect->top *
delta + (DestRect->left<<1));
color = (color&0xffff); /* If the color value is "abcd", put
"abcdabcd" into color */
color += (color<<16);
@@ -608,8 +608,8 @@
PIXEL *ScanLine, *ScanLineAhead;
PIXEL *PrevSource = NULL;
PIXEL *PrevSourceAhead = NULL;
- PIXEL *Target = (PIXEL *) (DestSurf->pvScan0 + (DestRect->top *
DestSurf->lDelta) + 2 * DestRect->left);
- PIXEL *Source = (PIXEL *) (SourceSurf->pvScan0 + (SourceRect->top *
SourceSurf->lDelta) + 2 * SourceRect->left);
+ PIXEL *Target = (PIXEL *) ((PBYTE)DestSurf->pvScan0 + (DestRect->top
* DestSurf->lDelta) + 2 * DestRect->left);
+ PIXEL *Source = (PIXEL *) ((PBYTE)SourceSurf->pvScan0 +
(SourceRect->top * SourceSurf->lDelta) + 2 * SourceRect->left);
PSPAN ClipSpans;
UINT ClipSpansCount;
UINT SpanIndex;
@@ -1406,7 +1406,7 @@
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left)
& 0x1);
SourceY = SourcePoint->y;
- DestBits = (ULONG*)(DestSurf->pvScan0 +
+ DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 +
(DestRect->left << 1) +
DestRect->top * DestSurf->lDelta);
wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 1);
_____
Modified: trunk/reactos/subsys/win32k/dib/dib1bpp.c
--- trunk/reactos/subsys/win32k/dib/dib1bpp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/win32k/dib/dib1bpp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -25,7 +25,7 @@
VOID
DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
{
- PBYTE addr = SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x >>
3);
if (0 == (c & 0x01))
*addr &= ~MASK1BPP(x);
@@ -36,7 +36,7 @@
ULONG
DIB_1BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
{
- PBYTE addr = SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x >>
3);
return (*addr & MASK1BPP(x) ? 1 : 0);
}
@@ -378,7 +378,7 @@
DestX = BltInfo->DestRect.left;
SourceX = BltInfo->SourcePoint.x;
DestBits = (PULONG)(
- BltInfo->DestSurface->pvScan0 +
+ (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left >> 3) +
DestY * BltInfo->DestSurface->lDelta);
_____
Modified: trunk/reactos/subsys/win32k/dib/dib24bpp.c
--- trunk/reactos/subsys/win32k/dib/dib24bpp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/win32k/dib/dib24bpp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -26,7 +26,7 @@
VOID
DIB_24BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
{
- PBYTE addr = SurfObj->pvScan0 + (y * SurfObj->lDelta) + (x << 1) + x;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + (y * SurfObj->lDelta) + (x <<
1) + x;
*(PUSHORT)(addr) = c & 0xFFFF;
*(addr + 2) = (c >> 16) & 0xFF;
}
@@ -34,14 +34,14 @@
ULONG
DIB_24BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
{
- PBYTE addr = SurfObj->pvScan0 + y * SurfObj->lDelta + (x << 1) + x;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x << 1)
+ x;
return *(PUSHORT)(addr) + (*(addr + 2) << 16);
}
VOID
DIB_24BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
- PBYTE addr = SurfObj->pvScan0 + y * SurfObj->lDelta + (x1 << 1) + x1;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x1 <<
1) + x1;
ULONG Count = x2 - x1;
#ifndef _M_IX86
ULONG MultiCount;
@@ -141,7 +141,7 @@
VOID
DIB_24BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
{
- PBYTE addr = SurfObj->pvScan0 + y1 * SurfObj->lDelta + (x << 1) + x;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta + (x <<
1) + x;
LONG lDelta = SurfObj->lDelta;
c &= 0xFFFFFF;
@@ -161,7 +161,7 @@
PBYTE SourceBits_4BPP, SourceLine_4BPP;
PWORD SourceBits_16BPP, SourceLine_16BPP;
- DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left * 3;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) +
BltInfo->DestRect.left * 3;
switch(BltInfo->SourceSurface->iBitmapFormat)
{
@@ -187,7 +187,7 @@
break;
case BMF_4BPP:
- SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
(BltInfo->SourcePoint.x >> 1);
+ SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
(BltInfo->SourcePoint.x >> 1);
for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{
@@ -213,7 +213,7 @@
break;
case BMF_8BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -236,7 +236,7 @@
break;
case BMF_16BPP:
- SourceBits_16BPP = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ SourceBits_16BPP = (PWORD)((PBYTE)BltInfo->SourceSurface->pvScan0
+ (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x);
for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{
@@ -262,7 +262,7 @@
{
if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
for (j = BltInfo->DestRect.top; j <
BltInfo->DestRect.bottom; j++)
{
RtlMoveMemory(DestBits, SourceBits, 3 *
(BltInfo->DestRect.right - BltInfo->DestRect.left));
@@ -272,8 +272,8 @@
}
else
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
- DestBits = BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 3 *
BltInfo->DestRect.left;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 3 *
BltInfo->DestRect.left;
for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top
<= j; j--)
{
RtlMoveMemory(DestBits, SourceBits, 3 *
(BltInfo->DestRect.right - BltInfo->DestRect.left));
@@ -291,7 +291,7 @@
break;
case BMF_32BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -337,7 +337,7 @@
SourceY = BltInfo->SourcePoint.y;
DestBits = (PBYTE)(
- BltInfo->DestSurface->pvScan0 +
+ (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 1) + BltInfo->DestRect.left +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
@@ -397,7 +397,7 @@
ULONG DestY;
#ifdef _M_IX86
- PBYTE xaddr = DestSurface->pvScan0 + DestRect->top *
DestSurface->lDelta + (DestRect->left << 1) + DestRect->left;
+ PBYTE xaddr = (PBYTE)DestSurface->pvScan0 + DestRect->top *
DestSurface->lDelta + (DestRect->left << 1) + DestRect->left;
PBYTE addr;
ULONG Count;
ULONG xCount=DestRect->right - DestRect->left;
@@ -1305,7 +1305,7 @@
BYTE *DestBits;
SourceY = SourcePoint->y;
- DestBits = (BYTE*)(DestSurf->pvScan0 +
+ DestBits = (BYTE*)((PBYTE)DestSurf->pvScan0 +
(DestRect->left << 2) +
DestRect->top * DestSurf->lDelta);
wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 2);
_____
Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c
--- trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -26,7 +26,7 @@
VOID
DIB_32BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
PDWORD addr = (PDWORD)byteaddr + x;
*addr = c;
@@ -35,7 +35,7 @@
ULONG
DIB_32BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
PDWORD addr = (PDWORD)byteaddr + x;
return (ULONG)(*addr);
@@ -47,7 +47,7 @@
DIB_32BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
LONG cx = (x2 - x1) ;
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
PDWORD addr = (PDWORD)byteaddr + x1;
__asm__ __volatile__ (
@@ -95,7 +95,7 @@
{
- PBYTE byteaddr = SurfObj->pvScan0 + y1 * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
PDWORD addr = (PDWORD)byteaddr + x;
LONG lDelta = SurfObj->lDelta >> 2; // >> 2 == / sizeof(DWORD)
@@ -116,7 +116,7 @@
PBYTE SourceBits_4BPP, SourceLine_4BPP;
PDWORD Source32, Dest32;
- DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta) + 4 * BltInfo->DestRect.left;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + 4 *
BltInfo->DestRect.left;
switch(BltInfo->SourceSurface->iBitmapFormat)
{
@@ -143,7 +143,7 @@
break;
case BMF_4BPP:
- SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
(BltInfo->SourcePoint.x >> 1);
+ SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
(BltInfo->SourcePoint.x >> 1);
for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{
@@ -165,7 +165,7 @@
break;
case BMF_8BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -187,7 +187,7 @@
break;
case BMF_16BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -209,7 +209,7 @@
break;
case BMF_24BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -237,7 +237,7 @@
{
if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
for (j = BltInfo->DestRect.top; j <
BltInfo->DestRect.bottom; j++)
{
RtlMoveMemory(DestBits, SourceBits, 4 *
(BltInfo->DestRect.right - BltInfo->DestRect.left));
@@ -247,8 +247,8 @@
}
else
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
- DestBits = BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 *
BltInfo->DestRect.left;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 *
BltInfo->DestRect.left;
for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top
<= j; j--)
{
RtlMoveMemory(DestBits, SourceBits, 4 *
(BltInfo->DestRect.right - BltInfo->DestRect.left));
@@ -261,7 +261,7 @@
{
if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{
- SourceBits = (BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x);
+ SourceBits = ((PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x);
for (j = BltInfo->DestRect.top; j <
BltInfo->DestRect.bottom; j++)
{
if (BltInfo->DestRect.left < BltInfo->SourcePoint.x)
@@ -288,8 +288,8 @@
}
else
{
- SourceBits = BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
- DestBits = BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 *
BltInfo->DestRect.left;
+ SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 *
BltInfo->DestRect.left;
for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top
<= j; j--)
{
if (BltInfo->DestRect.left < BltInfo->SourcePoint.x)
@@ -363,7 +363,7 @@
UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
SourceY = BltInfo->SourcePoint.y;
- DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
+ DestBits = (PULONG)((PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta);
Delta = BltInfo->DestSurface->lDelta - ((BltInfo->DestRect.right -
BltInfo->DestRect.left) << 2);
@@ -499,7 +499,7 @@
ULONG right = BltInfo->DestRect.right;
ULONG delta = BltInfo->DestSurface->lDelta -
((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2) ;
- DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
+ DestBits = (PULONG)((PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta);
for (DestY = BltInfo->DestRect.top; DestY < bottom; DestY++)
@@ -539,7 +539,7 @@
ULONG right = BltInfo->DestRect.right;
ULONG delta = BltInfo->DestSurface->lDelta -
((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2) ;
- DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
+ DestBits = (PULONG)((PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta);
SourceY = BltInfo->SourcePoint.y;
@@ -590,7 +590,7 @@
ULONG right = BltInfo->DestRect.right;
ULONG delta = BltInfo->DestSurface->lDelta -
((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2);
- DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
+ DestBits = (PULONG)((PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta);
SourceY = BltInfo->SourcePoint.y;
@@ -640,7 +640,7 @@
ULONG right = BltInfo->DestRect.right;
ULONG delta = BltInfo->DestSurface->lDelta -
((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2) ;
- DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
+ DestBits = (PULONG)((PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta);
SourceY = BltInfo->SourcePoint.y;
@@ -672,7 +672,7 @@
ULONG right = BltInfo->DestRect.right;
ULONG delta = BltInfo->DestSurface->lDelta -
((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2) ;
- DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
+ DestBits = (PULONG)((PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta);
SourceY = BltInfo->SourcePoint.y;
@@ -814,8 +814,8 @@
PIXEL *ScanLine, *ScanLineAhead;
PIXEL *PrevSource = NULL;
PIXEL *PrevSourceAhead = NULL;
- PIXEL *Target = (PIXEL *) (DestSurf->pvScan0 + (DestRect->top *
DestSurf->lDelta) + 4 * DestRect->left);
- PIXEL *Source = (PIXEL *) (SourceSurf->pvScan0 + (SourceRect->top *
SourceSurf->lDelta) + 4 * SourceRect->left);
+ PIXEL *Target = (PIXEL *) ((PBYTE)DestSurf->pvScan0 + (DestRect->top
* DestSurf->lDelta) + 4 * DestRect->left);
+ PIXEL *Source = (PIXEL *) ((PBYTE)SourceSurf->pvScan0 +
(SourceRect->top * SourceSurf->lDelta) + 4 * SourceRect->left);
PSPAN ClipSpans;
UINT ClipSpansCount;
UINT SpanIndex;
@@ -1607,7 +1607,7 @@
ULONG *DestBits;
SourceY = SourcePoint->y;
- DestBits = (ULONG*)(DestSurf->pvScan0 +
+ DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 +
(DestRect->left << 2) +
DestRect->top * DestSurf->lDelta);
wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 2);
_____
Modified: trunk/reactos/subsys/win32k/dib/dib4bpp.c
--- trunk/reactos/subsys/win32k/dib/dib4bpp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/win32k/dib/dib4bpp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -26,21 +26,21 @@
VOID
DIB_4BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
{
- PBYTE addr = SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
*addr = (*addr & notmask[x&1]) | (c << ((1-(x&1))<<2));
}
ULONG
DIB_4BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
{
- PBYTE addr = SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
return (*addr >> ((1-(x&1))<<2)) & 0x0f;
}
VOID
DIB_4BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
- PBYTE addr = SurfObj->pvScan0 + (x1>>1) + y * SurfObj->lDelta;
+ PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x1>>1) + y *
SurfObj->lDelta;
LONG cx = x1;
while(cx < x2) {
@@ -72,7 +72,7 @@
PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP;
PBYTE SourceBits, SourceLine;
- DestBits = BltInfo->DestSurface->pvScan0 +
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left >> 1) +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta;
@@ -123,7 +123,7 @@
break;
case BMF_8BPP:
- SourceBits_8BPP = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
+ SourceBits_8BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x;
for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{
@@ -145,7 +145,7 @@
break;
case BMF_16BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -169,7 +169,7 @@
break;
case BMF_24BPP:
- SourceBits_24BPP = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x * 3;
+ SourceBits_24BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
BltInfo->SourcePoint.x * 3;
for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{
@@ -194,7 +194,7 @@
break;
case BMF_32BPP:
- SourceLine = BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
+ SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
(BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 *
BltInfo->SourcePoint.x;
DestLine = DestBits;
for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom;
j++)
@@ -278,7 +278,7 @@
for (DestY = BltInfo->DestRect.top; DestY <
BltInfo->DestRect.bottom; DestY++)
{
DestBits = (PULONG)(
- BltInfo->DestSurface->pvScan0 +
+ (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left >> 1) +
DestY * BltInfo->DestSurface->lDelta);
SourceX = BltInfo->SourcePoint.x;
_____
Modified: trunk/reactos/subsys/win32k/dib/dib8bpp.c
--- trunk/reactos/subsys/win32k/dib/dib8bpp.c 2005-07-05 00:24:36 UTC
(rev 16420)
+++ trunk/reactos/subsys/win32k/dib/dib8bpp.c 2005-07-05 00:57:47 UTC
(rev 16421)
@@ -26,7 +26,7 @@
VOID
DIB_8BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta + x;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x;
*byteaddr = c;
}
@@ -34,7 +34,7 @@
ULONG
DIB_8BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta + x;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x;
return (ULONG)(*byteaddr);
}
@@ -42,13 +42,13 @@
VOID
DIB_8BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
- memset(SurfObj->pvScan0 + y * SurfObj->lDelta + x1, (BYTE) c, x2 -
x1);
+ memset((PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x1, (BYTE) c,
x2 - x1);
}
VOID
DIB_8BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
{
- PBYTE byteaddr = SurfObj->pvScan0 + y1 * SurfObj->lDelta;
+ PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
PBYTE addr = byteaddr + x;
LONG lDelta = SurfObj->lDelta;
@@ -67,7 +67,7 @@
PBYTE SourceBits, DestBits, SourceLine, DestLine;
PBYTE SourceBits_4BPP, SourceLine_4BPP;
- DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top *
BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
+ DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) +
BltInfo->DestRect.left;
switch(BltInfo->SourceSurface->iBitmapFormat)
[truncated at 1000 lines; 175 more skipped]