Author: tkreuzer
Date: Wed Jul 23 20:25:43 2008
New Revision: 34723
URL:
http://svn.reactos.org/svn/reactos?rev=34723&view=rev
Log:
freeldr:
- fix several ULONG to pointer casts
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] Wed
Jul 23 20:25:43 2008
@@ -137,9 +137,9 @@
if (ComPort == 0)
{
- if (Rs232DoesComPortExist ((PUCHAR)BaseArray[2]))
- {
- Rs232PortBase = (PUCHAR)BaseArray[2];
+ if (Rs232DoesComPortExist ((PUCHAR)(ULONG_PTR)BaseArray[2]))
+ {
+ Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[2];
Rs232ComPort = 2;
/*#ifndef NDEBUG
sprintf (buffer,
@@ -149,9 +149,9 @@
HalDisplayString (buffer);
#endif*/ /* NDEBUG */
}
- else if (Rs232DoesComPortExist ((PUCHAR)BaseArray[1]))
- {
- Rs232PortBase = (PUCHAR)BaseArray[1];
+ else if (Rs232DoesComPortExist
((PUCHAR)(ULONG_PTR)BaseArray[1]))
+ {
+ Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[1];
Rs232ComPort = 1;
/*#ifndef NDEBUG
sprintf (buffer,
@@ -171,9 +171,9 @@
}
else
{
- if (Rs232DoesComPortExist ((PUCHAR)BaseArray[ComPort]))
- {
- Rs232PortBase = (PUCHAR)BaseArray[ComPort];
+ if (Rs232DoesComPortExist
((PUCHAR)(ULONG_PTR)BaseArray[ComPort]))
+ {
+ Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[ComPort];
Rs232ComPort = ComPort;
/*#ifndef NDEBUG
sprintf (buffer,
@@ -280,7 +280,7 @@
BOOLEAN Rs232PortInUse(ULONG Base)
{
#ifdef DBG
- return PortInitialized && Rs232PortBase == (PUCHAR)Base ? TRUE : FALSE;
+ return PortInitialized && Rs232PortBase == (PUCHAR)(ULONG_PTR)Base ? TRUE :
FALSE;
#else
return FALSE;
#endif
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1]
Wed Jul 23 20:25:43 2008
@@ -66,7 +66,7 @@
//
// Get actual pointers and lengths
//
- StartAddress = (PVOID)((ULONG)SectorNumber * 512);
+ StartAddress = (PVOID)((ULONG_PTR)SectorNumber * 512);
Length = SectorCount * 512;
//
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] Wed Jul
23 20:25:43 2008
@@ -951,7 +951,7 @@
}
// Copy the data to their buffer
- RtlCopyMemory(InodeBuffer, (PVOID)(FILESYSBUFFER + (InodeOffsetInBlock *
EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE));
+ RtlCopyMemory(InodeBuffer, (PVOID)(ULONG_PTR)(FILESYSBUFFER + (InodeOffsetInBlock *
EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE));
DbgPrint((DPRINT_FILESYSTEM, "Dumping inode information:\n"));
DbgPrint((DPRINT_FILESYSTEM, "i_mode = 0x%x\n", InodeBuffer->i_mode));
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] Wed
Jul 23 20:25:43 2008
@@ -169,7 +169,7 @@
ULONG MmGetPageNumberFromAddress(PVOID Address)
{
- return ((ULONG)Address) / MM_PAGE_SIZE;
+ return ((ULONG_PTR)Address) / MM_PAGE_SIZE;
}
PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount)
@@ -195,7 +195,7 @@
DbgPrint((DPRINT_MEMORY, "MmGetEndAddressOfAnyMemory() returning 0x%x\n",
(ULONG)EndAddressOfMemory));
- return (PVOID)(ULONG)EndAddressOfMemory;
+ return (PVOID)(ULONG_PTR)EndAddressOfMemory;
}
ULONG MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG
MapCount)
@@ -203,7 +203,7 @@
ULONG PageCount;
ULONGLONG EndAddress;
- EndAddress = (ULONGLONG)(ULONG)MmGetEndAddressOfAnyMemory(BiosMemoryMap, MapCount);
+ EndAddress = (ULONGLONG)(ULONG_PTR)MmGetEndAddressOfAnyMemory(BiosMemoryMap, MapCount);
// Since MmGetEndAddressOfAnyMemory() won't
// return addresses higher than 0xFFFFFFFF
@@ -252,7 +252,7 @@
if (TempBiosMemoryMap[Index].Length >= PageLookupTableSize)
{
- PageLookupTableMemAddress = (PVOID)(ULONG)
+ PageLookupTableMemAddress = (PVOID)(ULONG_PTR)
(TempBiosMemoryMap[Index].BaseAddress + (TempBiosMemoryMap[Index].Length -
PageLookupTableSize));
break;
}
@@ -304,8 +304,8 @@
for (Index=0; Index<MapCount; Index++)
{
- MemoryMapStartPage =
MmGetPageNumberFromAddress((PVOID)(ULONG)BiosMemoryMap[Index].BaseAddress);
- MemoryMapEndPage =
MmGetPageNumberFromAddress((PVOID)(ULONG)(BiosMemoryMap[Index].BaseAddress +
BiosMemoryMap[Index].Length - 1));
+ MemoryMapStartPage =
MmGetPageNumberFromAddress((PVOID)(ULONG_PTR)BiosMemoryMap[Index].BaseAddress);
+ MemoryMapEndPage =
MmGetPageNumberFromAddress((PVOID)(ULONG_PTR)(BiosMemoryMap[Index].BaseAddress +
BiosMemoryMap[Index].Length - 1));
MemoryMapPageCount = (MemoryMapEndPage - MemoryMapStartPage) + 1;
switch (BiosMemoryMap[Index].Type)
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Wed Jul
23 20:25:43 2008
@@ -67,7 +67,7 @@
MmAllocatePagesInLookupTable(PageLookupTableAddress, FirstFreePageFromEnd, PagesNeeded,
MemoryType);
FreePagesInLookupTable -= PagesNeeded;
- MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE);
+ MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
#ifdef DBG
DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page
%d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd));
@@ -167,7 +167,7 @@
MmAllocatePagesInLookupTable(PageLookupTableAddress, StartPageNumber, PagesNeeded,
MemoryType);
FreePagesInLookupTable -= PagesNeeded;
- MemPointer = (PVOID)(StartPageNumber * MM_PAGE_SIZE);
+ MemPointer = (PVOID)((ULONG_PTR)StartPageNumber * MM_PAGE_SIZE);
#ifdef DBG
DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page
%d.\n", MemorySize, PagesNeeded, StartPageNumber));
@@ -201,7 +201,7 @@
PagesNeeded = ROUND_UP(MemorySize, MM_PAGE_SIZE) / MM_PAGE_SIZE;
// Get the page number for their desired address
- DesiredAddressPageNumber = (ULONG)DesiredAddress / MM_PAGE_SIZE;
+ DesiredAddressPageNumber = (ULONG_PTR)DesiredAddress / MM_PAGE_SIZE;
// If we don't have enough available mem
// then return NULL
@@ -224,7 +224,7 @@
MmAllocatePagesInLookupTable(PageLookupTableAddress, FirstFreePageFromEnd, PagesNeeded,
MemoryType);
FreePagesInLookupTable -= PagesNeeded;
- MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE);
+ MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
#ifdef DBG
DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page
%d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd));