See for example, in DrvEnableSurface(), etc.
TODO: framebufacc's comments need to be "translated" into actual English...
break;
}
- if (pCallBacks !=NULL)
+ if (pCallBacks != NULL)
{
memset(pCallBacks,0,sizeof(DD_CALLBACKS));
pCallBacks->dwFlags = DDHAL_CB32_CANCREATESURFACE | DDHAL_CB32_CREATESURFACE;
}
- if (pSurfaceCallBacks !=NULL)
+ if (pSurfaceCallBacks != NULL)
{
memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS));
// pSurfaceCallBacks->dwFlags = DDHAL_SURFCB32_DESTROYSURFACE | DDHAL_SURFCB32_LOCK | DDHAL_SURFCB32_BLT ;
}
- if (pPaletteCallBacks !=NULL)
+ if (pPaletteCallBacks != NULL)
{
memset(pPaletteCallBacks,0,sizeof(DD_PALETTECALLBACKS));
/* FILL pPaletteCallBacks with hal stuff */
&ulTemp))
{
EngFreeMem(*ModeInfo);
- *ModeInfo = (PVIDEO_MODE_INFORMATION)NULL;
+ *ModeInfo = NULL;
return 0;
}
&(ppdev->ModeIndex), sizeof(ULONG), NULL, 0,
&ulTemp))
{
- return FALSE;
+ return NULL;
}
/*
&VideoMemoryInfo, sizeof(VIDEO_MEMORY_INFORMATION),
&ulTemp))
{
- return FALSE;
+ return NULL;
}
ppdev->ScreenPtr = VideoMemoryInfo.FrameBufferBase;
break;
default:
- return FALSE;
+ return NULL;
}
ppdev->iDitherFormat = BitmapType;
ppdev->ScreenPtr);
if (hSurface == NULL)
{
- return FALSE;
+ return NULL;
}
/*
if (!EngAssociateSurface(hSurface, ppdev->hDevEng, 0))
{
EngDeleteSurface(hSurface);
- return FALSE;
+ return NULL;
}
ppdev->hSurfEng = hSurface;
pded->iDriverVersion = DDI_DRIVER_VERSION_NT4;
// eVb: 1.2 [END]
- return(TRUE);
+ return TRUE;
}
/******************************Public*Routine******************************\
{
GDIINFO GdiInfo;
DEVINFO DevInfo;
- PPDEV ppdev = (PPDEV) NULL;
+ PPDEV ppdev = NULL;
UNREFERENCED_PARAMETER(pwszLogAddress);
UNREFERENCED_PARAMETER(pwszDeviceName);
ppdev = (PPDEV) EngAllocMem(0, sizeof(PDEV), ALLOC_TAG);
- if (ppdev == (PPDEV) NULL)
+ if (ppdev == NULL)
{
RIP("DISP DrvEnablePDEV failed EngAllocMem\n");
- return((DHPDEV) 0);
+ return NULL;
}
memset(ppdev, 0, sizeof(PDEV));
memcpy(pGdiInfo, &GdiInfo, min(cjGdiInfo, sizeof(GDIINFO)));
- return((DHPDEV) ppdev);
+ return (DHPDEV)ppdev;
// Error case for failure.
error_free:
EngFreeMem(ppdev);
- return((DHPDEV) 0);
+ return NULL;
}
/******************************Public*Routine******************************\
if (!bInitSURF(ppdev, TRUE))
{
RIP("DISP DrvEnableSurface failed bInitSURF\n");
- return(FALSE);
+ return NULL;
}
sizl.cx = ppdev->cxScreen;
{
if (!bInit256ColorPalette(ppdev)) {
RIP("DISP DrvEnableSurface failed to init the 8bpp palette\n");
- return(FALSE);
+ return NULL;
}
ulBitmapType = BMF_8BPP;
flHooks = HOOKS_BMF8BPP;
sizl,
ulBitmapType);
- if (hsurf == (HSURF) 0)
+ if (hsurf == NULL)
{
RIP("DISP DrvEnableSurface failed EngCreateDeviceSurface\n");
- return(FALSE);
+ return NULL;
}
// eVb: 1.4 [END]
NULL))
{
RIP("DISP DrvEnableSurface failed EngModifySurface\n");
- return(FALSE);
+ return NULL;
}
// eVb: 1.5 [END]
ppdev->hsurfEng = hsurf;
- return(hsurf);
+ return hsurf;
}
/******************************Public*Routine******************************\
{
EngDeleteSurface(((PPDEV) dhpdev)->hsurfEng);
vDisableSURF((PPDEV) dhpdev);
- ((PPDEV) dhpdev)->hsurfEng = (HSURF) 0;
+ ((PPDEV) dhpdev)->hsurfEng = NULL;
}
/******************************Public*Routine******************************\
if (!bInitSURF(ppdev, FALSE))
{
DISPDBG((0, "DISP DrvAssertMode failed bInitSURF\n"));
- return (FALSE);
+ return FALSE;
}
if (pjScreen != ppdev->pjScreen) {
NULL))
{
DISPDBG((0, "DISP DrvAssertMode failed EngModifySurface\n"));
- return (FALSE);
+ return FALSE;
}
}
// eVb: 1.6 [END]
- return (TRUE);
+ return TRUE;
}
else
{
if (ppdev->hpalDefault)
{
EngDeletePalette(ppdev->hpalDefault);
- ppdev->hpalDefault = (HPALETTE) 0;
+ ppdev->hpalDefault = NULL;
}
- if (ppdev->pPal != (PPALETTEENTRY)NULL)
+ if (ppdev->pPal != NULL)
EngFreeMem((PVOID)ppdev->pPal);
}
(PULONG) ppdev->pPal,
0,0,0);
- if (ppdev->hpalDefault == (HPALETTE) 0)
+ if (ppdev->hpalDefault == NULL)
{
RIP("DISP bInitDefaultPalette failed EngCreatePalette\n");
EngFreeMem(ppdev->pPal);
ppdev->hpalDefault =
pDevInfo->hpalDefault = EngCreatePalette(PAL_BITFIELDS,
- 0,(PULONG) NULL,
+ 0, NULL,
ppdev->flRed,
ppdev->flGreen,
ppdev->flBlue);
- if (ppdev->hpalDefault == (HPALETTE) 0)
+ if (ppdev->hpalDefault == NULL)
{
RIP("DISP bInitDefaultPalette failed EngCreatePalette\n");
return(FALSE);
// to exclude out pointer before drawing to the pixels in prcl.
UNREFERENCED_PARAMETER(prcl);
- if (ppdev->pPointerAttributes == (PVIDEO_POINTER_ATTRIBUTES) NULL)
+ if (ppdev->pPointerAttributes == NULL)
{
// Mini-port has no hardware Pointer support.
return(SPS_ERROR);
// See if we are being asked to hide the pointer
- if (psoMask == (SURFOBJ *) NULL)
+ if (psoMask == NULL)
{
if (EngDeviceIoControl(ppdev->hDriver,
IOCTL_VIDEO_DISABLE_POINTER,
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = ppdev->pPointerAttributes;
DWORD returnedDataLength;
- if (psoColor != (SURFOBJ *) NULL)
+ if (psoColor != NULL)
{
if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) &&
bCopyColorPointer(ppdev, psoMask, psoColor, pxlo))
{
DWORD returnedDataLength;
- ppdev->pPointerAttributes = (PVIDEO_POINTER_ATTRIBUTES) NULL;
+ ppdev->pPointerAttributes = NULL;
ppdev->cjPointerAttributes = 0; // initialized in screen.c
//
&ulTemp))
{
DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n"));
- return(0);
+ return 0;
}
*cbModeSize = modes.ModeInformationLength;
EngAllocMem(0, modes.NumModes *
modes.ModeInformationLength, ALLOC_TAG);
- if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL)
+ if (*modeInformation == NULL)
{
DISPDBG((0, "getAvailableModes failed EngAllocMem\n"));
DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n"));
EngFreeMem(*modeInformation);
- *modeInformation = (PVIDEO_MODE_INFORMATION) NULL;
+ *modeInformation = NULL;
- return(0);
+ return 0;
}
//
break;
}
- if (pCallBacks !=NULL)
+ if (pCallBacks != NULL)
{
memset(pCallBacks,0,sizeof(DD_CALLBACKS));
pCallBacks->dwFlags = DDHAL_CB32_CANCREATESURFACE | DDHAL_CB32_CREATESURFACE;
}
- if (pSurfaceCallBacks !=NULL)
+ if (pSurfaceCallBacks != NULL)
{
memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS));
// pSurfaceCallBacks->dwFlags = DDHAL_SURFCB32_DESTROYSURFACE | DDHAL_SURFCB32_LOCK | DDHAL_SURFCB32_BLT ;
}
- if (pPaletteCallBacks !=NULL)
+ if (pPaletteCallBacks != NULL)
{
memset(pPaletteCallBacks,0,sizeof(DD_PALETTECALLBACKS));
/* FILL pPaletteCallBacks with hal stuff */
}
/* check see if the apps ask to hide the mouse or not */
- if (psoMask == (SURFOBJ *) NULL)
+ if (psoMask == NULL)
{
if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
{
/* Set the hw mouse shape */
- if (psoColor != (SURFOBJ *) NULL)
+ if (psoColor != NULL)
{
/* We got a color mouse pointer */
if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) &&
&ulTemp))
{
EngFreeMem(*ModeInfo);
- *ModeInfo = (PVIDEO_MODE_INFORMATION)NULL;
+ *ModeInfo = NULL;
return 0;
}
/* Setup surface and force the mapping */
if (!InitSurface(ppdev, TRUE))
{
- return FALSE;
+ return NULL;
}
/* Rest the desktop vitual position */
break;
default:
- return FALSE;
+ return NULL;
}
ppdev->iDitherFormat = BitmapType;
ppdev->ScreenPtr);
if (hSurface == NULL)
{
- return FALSE;
+ return NULL;
}
/* Which api we hooking to */
if (!EngAssociateSurface(hSurface, ppdev->hDevEng, ppdev->dwHooks))
{
EngDeleteSurface(hSurface);
- return FALSE;
+ return NULL;
}
ppdev->hSurfEng = hSurface;
/* free any pending saved screen bit blocks */
#if 0
pSSB = pdsurf->ssbList;
- while (pSSB != (PSAVED_SCREEN_BITS) NULL)
+ while (pSSB != NULL)
{
/* Point to the next saved screen bits block */
pSSBNext = (PSAVED_SCREEN_BITS) pSSB->pvNextSSB;
/* dhsurf is of type DEVSURF, which is the drivers specialized surface type */
dhsurf = (DHSURF)EngAllocMem(0, sizeof(DEVSURF), ALLOC_TAG);
- if (dhsurf == (DHSURF) 0)
+ if (dhsurf == NULL)
goto error_done;
pdsurf = (PDEVSURF) dhsurf;
} BANKING CODE UNIMPLEMENTED */
if ((hsurf = EngCreateDeviceSurface(dhsurf, ppdev->sizeSurf, BMF_4BPP)) ==
- (HSURF)0)
+ NULL)
{
/* Call to EngCreateDeviceSurface failed */
DPRINT("EngCreateDeviceSurface call failed\n");
EngFreeMem(dhsurf);
error_done:
- return (HSURF)0;
+ return NULL;
}
// If VGADDIPaint can't do it, VGADDIBitBlt can.. or it might just loop back
// here and we have a nice infinite loop
- return( VGADDIBitBlt(Surface, (SURFOBJ *)NULL, (SURFOBJ *)NULL, ClipRegion,
- (XLATEOBJ *)NULL, &ClipRegion->rclBounds,
- NULL, (POINTL *)NULL, Brush, BrushOrigin,
+ return( VGADDIBitBlt(Surface, NULL, NULL, ClipRegion,
+ NULL, &ClipRegion->rclBounds,
+ NULL, NULL, Brush, BrushOrigin,
NULL) ); UNIMPLEMENTED */
}
EngAllocMem(0, modes.NumModes *
modes.ModeInformationLength, ALLOC_TAG);
- if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL)
+ if (*modeInformation == NULL)
{
/* couldn't allocate buffer */
return 0;
{
/* failed to query modes */
EngFreeMem(*modeInformation);
- *modeInformation = (PVIDEO_MODE_INFORMATION) NULL;
+ *modeInformation = NULL;
return 0;
}
pded->iDriverVersion = DDI_DRIVER_VERSION_NT4;
// eVb: 1.2 [END]
- return(TRUE);
+ return TRUE;
}
/******************************Public*Routine******************************\
{
GDIINFO GdiInfo;
DEVINFO DevInfo;
- PPDEV ppdev = (PPDEV) NULL;
+ PPDEV ppdev = NULL;
UNREFERENCED_PARAMETER(pwszLogAddress);
UNREFERENCED_PARAMETER(pwszDeviceName);
ppdev = (PPDEV) EngAllocMem(0, sizeof(PDEV), ALLOC_TAG);
- if (ppdev == (PPDEV) NULL)
+ if (ppdev == NULL)
{
RIP("DISP DrvEnablePDEV failed EngAllocMem\n");
- return((DHPDEV) 0);
+ return NULL;
}
memset(ppdev, 0, sizeof(PDEV));
memcpy(pGdiInfo, &GdiInfo, min(cjGdiInfo, sizeof(GDIINFO)));
- return((DHPDEV) ppdev);
+ return (DHPDEV)ppdev;
// Error case for failure.
error_free:
EngFreeMem(ppdev);
- return((DHPDEV) 0);
+ return NULL;
}
/******************************Public*Routine******************************\
if (!bInitSURF(ppdev, TRUE))
{
RIP("DISP DrvEnableSurface failed bInitSURF\n");
- return(FALSE);
+ return NULL;
}
sizl.cx = ppdev->cxScreen;
{
if (!bInit256ColorPalette(ppdev)) {
RIP("DISP DrvEnableSurface failed to init the 8bpp palette\n");
- return(FALSE);
+ return NULL;
}
ulBitmapType = BMF_8BPP;
flHooks = HOOKS_BMF8BPP;
#endif
// eVb: 1.3 [END]
// eVb: 1.4 [DDK Change] - Use EngCreateDeviceSurface instead of EngCreateBitmap
- hsurf = (HSURF)EngCreateDeviceSurface((DHSURF)ppdev,
+ hsurf = (HSURF)EngCreateDeviceSurface((DHSURF)ppdev,
sizl,
ulBitmapType);
- if (hsurf == (HSURF) 0)
+ if (hsurf == NULL)
{
RIP("DISP DrvEnableSurface failed EngCreateDeviceSurface\n");
- return(FALSE);
+ return NULL;
}
// eVb: 1.4 [END]
NULL))
{
RIP("DISP DrvEnableSurface failed EngModifySurface\n");
- return(FALSE);
+ return NULL;
}
// eVb: 1.5 [END]
ppdev->hsurfEng = hsurf;
// eVb: 1.4 [VGARISC Change] - Allocate 4BPP DIB that will store GDI drawing
hSurfBitmap = (HSURF)EngCreateBitmap(sizl, 0, ulBitmapType, 0, NULL);
- if (hSurfBitmap == (HSURF) 0)
+ if (hSurfBitmap == NULL)
{
RIP("DISP DrvEnableSurface failed EngCreateBitmap\n");
- return(FALSE);
+ return NULL;
}
if ( !EngModifySurface(hSurfBitmap,
NULL))
{
RIP("DISP DrvEnableSurface failed second EngModifySurface\n");
- return(FALSE);
+ return NULL;
}
ppdev->pso = EngLockSurface(hSurfBitmap);
if (ppdev->pso == NULL)
{
RIP("DISP DrvEnableSurface failed EngLockSurface\n");
- return(FALSE);
+ return NULL;
}
// eVb: 1.4 [END]
- return(hsurf);
+ return hsurf;
}
/******************************Public*Routine******************************\
{
EngDeleteSurface(((PPDEV) dhpdev)->hsurfEng);
vDisableSURF((PPDEV) dhpdev);
- ((PPDEV) dhpdev)->hsurfEng = (HSURF) 0;
+ ((PPDEV) dhpdev)->hsurfEng = NULL;
}
/******************************Public*Routine******************************\
if (ppdev->hpalDefault)
{
EngDeletePalette(ppdev->hpalDefault);
- ppdev->hpalDefault = (HPALETTE) 0;
+ ppdev->hpalDefault = NULL;
}
// eVb: 4.2 [VGARISC Change] - VGA Palette is static, no need to free
#if 0
- if (ppdev->pPal != (PPALETTEENTRY)NULL)
+ if (ppdev->pPal != NULL)
EngFreeMem((PVOID)ppdev->pPal);
#endif
// eVb: 4.2 [END]
// eVb: 4.4 [END]
0,0,0);
- if (ppdev->hpalDefault == (HPALETTE) 0)
+ if (ppdev->hpalDefault == NULL)
{
RIP("DISP bInitDefaultPalette failed EngCreatePalette\n");
// eVb: 4.5 [VGARISC Change] - VGA Palette is static, no need to free
ppdev->hpalDefault =
pDevInfo->hpalDefault = EngCreatePalette(PAL_BITFIELDS,
- 0,(PULONG) NULL,
+ 0, NULL,
ppdev->flRed,
ppdev->flGreen,
ppdev->flBlue);
- if (ppdev->hpalDefault == (HPALETTE) 0)
+ if (ppdev->hpalDefault == NULL)
{
RIP("DISP bInitDefaultPalette failed EngCreatePalette\n");
return(FALSE);
&ulTemp))
{
DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n"));
- return(0);
+ return 0;
}
*cbModeSize = modes.ModeInformationLength;
EngAllocMem(0, modes.NumModes *
modes.ModeInformationLength, ALLOC_TAG);
- if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL)
+ if (*modeInformation == NULL)
{
DISPDBG((0, "getAvailableModes failed EngAllocMem\n"));
DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n"));
EngFreeMem(*modeInformation);
- *modeInformation = (PVIDEO_MODE_INFORMATION) NULL;
+ *modeInformation = NULL;
- return(0);
+ return 0;
}
//