diff --git a/client/Android/android_freerdp.c b/client/Android/android_freerdp.c index a443c4ff6..54a96feb8 100644 --- a/client/Android/android_freerdp.c +++ b/client/Android/android_freerdp.c @@ -146,7 +146,7 @@ static BOOL android_begin_paint(rdpContext* context) if (!hwnd || !hwnd->invalid) return FALSE; - hwnd->invalid->null = 1; + hwnd->invalid->null = TRUE; hwnd->ninvalid = 0; return TRUE; } diff --git a/client/DirectFB/dfreerdp.c b/client/DirectFB/dfreerdp.c index 2116463c1..0a867d8a2 100644 --- a/client/DirectFB/dfreerdp.c +++ b/client/DirectFB/dfreerdp.c @@ -61,7 +61,7 @@ void df_context_free(freerdp* instance, rdpContext* context) void df_begin_paint(rdpContext* context) { rdpGdi* gdi = context->gdi; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; } void df_end_paint(rdpContext* context) diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index ee6bc2d94..391ab8690 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -1156,7 +1156,7 @@ BOOL mac_begin_paint(rdpContext* context) if (!gdi) return FALSE; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; return TRUE; } diff --git a/client/Sample/freerdp.c b/client/Sample/freerdp.c index c743006fd..3c5bc38a2 100644 --- a/client/Sample/freerdp.c +++ b/client/Sample/freerdp.c @@ -59,7 +59,7 @@ static void tf_context_free(freerdp* instance, rdpContext* context) static BOOL tf_begin_paint(rdpContext* context) { rdpGdi* gdi = context->gdi; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; return TRUE; } diff --git a/client/Wayland/wlfreerdp.c b/client/Wayland/wlfreerdp.c index b9e8e9fcc..babdc749f 100644 --- a/client/Wayland/wlfreerdp.c +++ b/client/Wayland/wlfreerdp.c @@ -53,7 +53,7 @@ static BOOL wl_begin_paint(rdpContext* context) { rdpGdi* gdi; gdi = context->gdi; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; return TRUE; } diff --git a/client/Windows/wf_client.c b/client/Windows/wf_client.c index 0a8f052c9..5cca741a1 100644 --- a/client/Windows/wf_client.c +++ b/client/Windows/wf_client.c @@ -127,7 +127,7 @@ static BOOL wf_begin_paint(rdpContext* context) if (!hdc || !hdc->hwnd || !hdc->hwnd->invalid) return FALSE; - hdc->hwnd->invalid->null = 1; + hdc->hwnd->invalid->null = TRUE; hdc->hwnd->ninvalid = 0; return TRUE; } diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index bcbbf7756..d7a04a932 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -288,7 +288,7 @@ static BOOL xf_desktop_resize(rdpContext* context) static BOOL xf_sw_begin_paint(rdpContext* context) { rdpGdi* gdi = context->gdi; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; gdi->primary->hdc->hwnd->ninvalid = 0; return TRUE; } @@ -390,7 +390,7 @@ out: static BOOL xf_hw_begin_paint(rdpContext* context) { xfContext* xfc = (xfContext*) context; - xfc->hdc->hwnd->invalid->null = 1; + xfc->hdc->hwnd->invalid->null = TRUE; xfc->hdc->hwnd->ninvalid = 0; return TRUE; } diff --git a/client/iOS/FreeRDP/ios_freerdp_ui.m b/client/iOS/FreeRDP/ios_freerdp_ui.m index 0feae9d2b..abf3e722a 100644 --- a/client/iOS/FreeRDP/ios_freerdp_ui.m +++ b/client/iOS/FreeRDP/ios_freerdp_ui.m @@ -132,7 +132,7 @@ DWORD ios_ui_verify_changed_certificate(freerdp* instance, BOOL ios_ui_begin_paint(rdpContext* context) { rdpGdi* gdi = context->gdi; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; return TRUE; } @@ -144,7 +144,7 @@ BOOL ios_ui_end_paint(rdpContext* context) gdi->primary->hdc->hwnd->invalid->y, gdi->primary->hdc->hwnd->invalid->w, gdi->primary->hdc->hwnd->invalid->h); - if (gdi->primary->hdc->hwnd->invalid->null == 0) + if (!gdi->primary->hdc->hwnd->invalid->null) [mfi->session performSelectorOnMainThread:@selector( setNeedsDisplayInRectAsValue:) withObject:[NSValue valueWithCGRect:dirty_rect] waitUntilDone:NO]; diff --git a/libfreerdp/gdi/clipping.c b/libfreerdp/gdi/clipping.c index e4d0a02dd..73b54ae72 100644 --- a/libfreerdp/gdi/clipping.c +++ b/libfreerdp/gdi/clipping.c @@ -61,7 +61,7 @@ HGDI_RGN gdi_GetClipRgn(HGDI_DC hdc) BOOL gdi_SetNullClipRgn(HGDI_DC hdc) { gdi_SetClipRgn(hdc, 0, 0, 0, 0); - hdc->clip->null = 1; + hdc->clip->null = TRUE; return TRUE; } diff --git a/libfreerdp/gdi/dc.c b/libfreerdp/gdi/dc.c index acad87d15..a2dd5ba20 100644 --- a/libfreerdp/gdi/dc.c +++ b/libfreerdp/gdi/dc.c @@ -58,7 +58,7 @@ HGDI_DC gdi_GetDC(void) return NULL; } - hDC->clip->null = 1; + hDC->clip->null = TRUE; hDC->hwnd = NULL; return hDC; } @@ -81,7 +81,7 @@ HGDI_DC gdi_CreateDC(UINT32 format) if (!(hDC->clip = gdi_CreateRectRgn(0, 0, 0, 0))) goto fail; - hDC->clip->null = 1; + hDC->clip->null = TRUE; hDC->hwnd = NULL; hDC->format = format; @@ -91,11 +91,11 @@ HGDI_DC gdi_CreateDC(UINT32 format) if (!(hDC->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0))) goto fail; - hDC->hwnd->invalid->null = 1; + hDC->hwnd->invalid->null = TRUE; hDC->hwnd->count = 32; if (!(hDC->hwnd->cinvalid = (HGDI_RGN) calloc(hDC->hwnd->count, - sizeof(GDI_RGN)))) + sizeof(GDI_RGN)))) goto fail; hDC->hwnd->ninvalid = 0; @@ -125,7 +125,7 @@ HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc) return NULL; } - hDC->clip->null = 1; + hDC->clip->null = TRUE; hDC->format = hdc->format; hDC->drawMode = hdc->drawMode; hDC->hwnd = NULL; diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index aa75873fe..7d638ff6b 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -1146,7 +1146,7 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, if (!(gdi->primary->hdc->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0))) goto fail_hwnd; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; gdi->primary->hdc->hwnd->count = 32; if (!(gdi->primary->hdc->hwnd->cinvalid = (HGDI_RGN) calloc( diff --git a/libfreerdp/gdi/region.c b/libfreerdp/gdi/region.c index a2f19d47b..4b9a75721 100644 --- a/libfreerdp/gdi/region.c +++ b/libfreerdp/gdi/region.c @@ -60,7 +60,7 @@ HGDI_RGN gdi_CreateRectRgn(UINT32 nLeftRect, UINT32 nTopRect, hRgn->y = nTopRect; hRgn->w = nRightRect - nLeftRect + 1; hRgn->h = nBottomRect - nTopRect + 1; - hRgn->null = 0; + hRgn->null = FALSE; return hRgn; } @@ -312,7 +312,7 @@ INLINE BOOL gdi_SetRgn(HGDI_RGN hRgn, UINT32 nXLeft, UINT32 nYLeft, hRgn->y = nYLeft; hRgn->w = nWidth; hRgn->h = nHeight; - hRgn->null = 0; + hRgn->null = FALSE; return TRUE; } @@ -330,7 +330,7 @@ INLINE BOOL gdi_SetRectRgn(HGDI_RGN hRgn, UINT32 nLeftRect, UINT32 nTopRect, UINT32 nRightRect, UINT32 nBottomRect) { gdi_CRectToRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, hRgn); - hRgn->null = 0; + hRgn->null = FALSE; return TRUE; } @@ -452,7 +452,7 @@ INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, UINT32 x, UINT32 y, UINT32 w, invalid->y = y; invalid->w = w; invalid->h = h; - invalid->null = 0; + invalid->null = FALSE; return TRUE; } diff --git a/libfreerdp/gdi/test/TestGdiClip.c b/libfreerdp/gdi/test/TestGdiClip.c index 6fbf2c049..2c64b49ab 100644 --- a/libfreerdp/gdi/test/TestGdiClip.c +++ b/libfreerdp/gdi/test/TestGdiClip.c @@ -33,8 +33,8 @@ static int test_gdi_ClipCoords(void) gdi_SetNullClipRgn(hdc); rgn1 = gdi_CreateRectRgn(0, 0, 0, 0); rgn2 = gdi_CreateRectRgn(0, 0, 0, 0); - rgn1->null = 1; - rgn2->null = 1; + rgn1->null = TRUE; + rgn2->null = TRUE; /* null clipping region */ gdi_SetNullClipRgn(hdc); gdi_SetRgn(rgn1, 20, 20, 100, 100); @@ -180,16 +180,16 @@ static int test_gdi_InvalidateRegion(void) gdi_SetNullClipRgn(hdc); hdc->hwnd = (HGDI_WND) calloc(1, sizeof(GDI_WND)); hdc->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0); - hdc->hwnd->invalid->null = 1; + hdc->hwnd->invalid->null = TRUE; invalid = hdc->hwnd->invalid; hdc->hwnd->count = 16; hdc->hwnd->cinvalid = (HGDI_RGN) calloc(hdc->hwnd->count, sizeof(GDI_RGN)); rgn1 = gdi_CreateRectRgn(0, 0, 0, 0); rgn2 = gdi_CreateRectRgn(0, 0, 0, 0); - rgn1->null = 1; - rgn2->null = 1; + rgn1->null = TRUE; + rgn2->null = TRUE; /* no previous invalid region */ - invalid->null = 1; + invalid->null = TRUE; gdi_SetRgn(rgn1, 300, 300, 100, 100); gdi_SetRgn(rgn2, 300, 300, 100, 100); gdi_InvalidateRegion(hdc, rgn1->x, rgn1->y, rgn1->w, rgn1->h); diff --git a/server/shadow/Win/win_rdp.c b/server/shadow/Win/win_rdp.c index 5de169c3b..a1a968a5c 100644 --- a/server/shadow/Win/win_rdp.c +++ b/server/shadow/Win/win_rdp.c @@ -47,7 +47,7 @@ BOOL shw_begin_paint(rdpContext* context) shwContext* shw; rdpGdi* gdi = context->gdi; shw = (shwContext*) context; - gdi->primary->hdc->hwnd->invalid->null = 1; + gdi->primary->hdc->hwnd->invalid->null = TRUE; gdi->primary->hdc->hwnd->ninvalid = 0; return TRUE; } @@ -62,7 +62,6 @@ BOOL shw_end_paint(rdpContext* context) shwContext* shw = (shwContext*) context; winShadowSubsystem* subsystem = shw->subsystem; rdpShadowSurface* surface = subsystem->server->surface; - ninvalid = gdi->primary->hdc->hwnd->ninvalid; cinvalid = gdi->primary->hdc->hwnd->cinvalid; @@ -72,8 +71,8 @@ BOOL shw_end_paint(rdpContext* context) invalidRect.top = cinvalid[index].y; invalidRect.right = cinvalid[index].x + cinvalid[index].w; invalidRect.bottom = cinvalid[index].y + cinvalid[index].h; - - region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); + region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), + &invalidRect); } SetEvent(subsystem->RdpUpdateEnterEvent); @@ -88,7 +87,7 @@ BOOL shw_desktop_resize(rdpContext* context) } BOOL shw_surface_frame_marker(rdpContext* context, - const SURFACE_FRAME_MARKER* surfaceFrameMarker) + const SURFACE_FRAME_MARKER* surfaceFrameMarker) { shwContext* shw = (shwContext*) context; return TRUE;