[PATCH] rdp-compositor: fix compilation with FreeRDP 2.0-rc4

David Fort rdp.effort at gmail.com
Tue Dec 4 22:43:33 UTC 2018


Some members have been removed from FreeRDP structs, so let's use local
variables.
---
 libweston/compositor-rdp.c | 86 +++++++++++++++++++-------------------
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
index 134e7298..871a0a3e 100644
--- a/libweston/compositor-rdp.c
+++ b/libweston/compositor-rdp.c
@@ -67,19 +67,19 @@
 #endif
 
 #ifdef HAVE_SURFACE_BITS_BMP
-#define SURFACE_BPP(cmd) cmd->bmp.bpp
-#define SURFACE_CODECID(cmd) cmd->bmp.codecID
-#define SURFACE_WIDTH(cmd) cmd->bmp.width
-#define SURFACE_HEIGHT(cmd) cmd->bmp.height
-#define SURFACE_BITMAP_DATA(cmd) cmd->bmp.bitmapData
-#define SURFACE_BITMAP_DATA_LEN(cmd) cmd->bmp.bitmapDataLength
+#define SURFACE_BPP(cmd) cmd.bmp.bpp
+#define SURFACE_CODECID(cmd) cmd.bmp.codecID
+#define SURFACE_WIDTH(cmd) cmd.bmp.width
+#define SURFACE_HEIGHT(cmd) cmd.bmp.height
+#define SURFACE_BITMAP_DATA(cmd) cmd.bmp.bitmapData
+#define SURFACE_BITMAP_DATA_LEN(cmd) cmd.bmp.bitmapDataLength
 #else
-#define SURFACE_BPP(cmd) cmd->bpp
-#define SURFACE_CODECID(cmd) cmd->codecID
-#define SURFACE_WIDTH(cmd) cmd->width
-#define SURFACE_HEIGHT(cmd) cmd->height
-#define SURFACE_BITMAP_DATA(cmd) cmd->bitmapData
-#define SURFACE_BITMAP_DATA_LEN(cmd) cmd->bitmapDataLength
+#define SURFACE_BPP(cmd) cmd.bpp
+#define SURFACE_CODECID(cmd) cmd.codecID
+#define SURFACE_WIDTH(cmd) cmd.width
+#define SURFACE_HEIGHT(cmd) cmd.height
+#define SURFACE_BITMAP_DATA(cmd) cmd.bitmapData
+#define SURFACE_BITMAP_DATA_LEN(cmd) cmd.bitmapDataLength
 #endif
 
 #include <freerdp/freerdp.h>
@@ -198,7 +198,7 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
 	uint32_t *ptr;
 	RFX_RECT *rfxRect;
 	rdpUpdate *update = peer->update;
-	SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command;
+	SURFACE_BITS_COMMAND cmd;
 	RdpPeerContext *context = (RdpPeerContext *)peer->context;
 
 	Stream_Clear(context->encode_stream);
@@ -208,14 +208,14 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
 	height = (damage->extents.y2 - damage->extents.y1);
 
 #ifdef HAVE_SKIP_COMPRESSION
-	cmd->skipCompression = TRUE;
+	cmd.skipCompression = TRUE;
 #else
-	memset(cmd, 0, sizeof(*cmd));
+	memset(&cmd, 0, sizeof(*cmd));
 #endif
-	cmd->destLeft = damage->extents.x1;
-	cmd->destTop = damage->extents.y1;
-	cmd->destRight = damage->extents.x2;
-	cmd->destBottom = damage->extents.y2;
+	cmd.destLeft = damage->extents.x1;
+	cmd.destTop = damage->extents.y1;
+	cmd.destRight = damage->extents.x2;
+	cmd.destBottom = damage->extents.y2;
 	SURFACE_BPP(cmd) = 32;
 	SURFACE_CODECID(cmd) = peer->settings->RemoteFxCodecId;
 	SURFACE_WIDTH(cmd) = width;
@@ -245,7 +245,7 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
 	SURFACE_BITMAP_DATA_LEN(cmd) = Stream_GetPosition(context->encode_stream);
 	SURFACE_BITMAP_DATA(cmd) = Stream_Buffer(context->encode_stream);
 
-	update->SurfaceBits(update->context, cmd);
+	update->SurfaceBits(update->context, &cmd);
 }
 
 
@@ -255,7 +255,7 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
 	int width, height;
 	uint32_t *ptr;
 	rdpUpdate *update = peer->update;
-	SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command;
+	SURFACE_BITS_COMMAND cmd;
 	RdpPeerContext *context = (RdpPeerContext *)peer->context;
 
 	Stream_Clear(context->encode_stream);
@@ -265,15 +265,15 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
 	height = (damage->extents.y2 - damage->extents.y1);
 
 #ifdef HAVE_SKIP_COMPRESSION
-	cmd->skipCompression = TRUE;
+	cmd.skipCompression = TRUE;
 #else
 	memset(cmd, 0, sizeof(*cmd));
 #endif
 
-	cmd->destLeft = damage->extents.x1;
-	cmd->destTop = damage->extents.y1;
-	cmd->destRight = damage->extents.x2;
-	cmd->destBottom = damage->extents.y2;
+	cmd.destLeft = damage->extents.x1;
+	cmd.destTop = damage->extents.y1;
+	cmd.destRight = damage->extents.x2;
+	cmd.destBottom = damage->extents.y2;
 	SURFACE_BPP(cmd) = 32;
 	SURFACE_CODECID(cmd) = peer->settings->NSCodecId;
 	SURFACE_WIDTH(cmd) = width;
@@ -289,7 +289,7 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
 	SURFACE_BITMAP_DATA_LEN(cmd) = Stream_GetPosition(context->encode_stream);
 	SURFACE_BITMAP_DATA(cmd) = Stream_Buffer(context->encode_stream);
 
-	update->SurfaceBits(update->context, cmd);
+	update->SurfaceBits(update->context, &cmd);
 }
 
 static void
@@ -310,8 +310,8 @@ static void
 rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_peer *peer)
 {
 	rdpUpdate *update = peer->update;
-	SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command;
-	SURFACE_FRAME_MARKER *marker = &update->surface_frame_marker;
+	SURFACE_BITS_COMMAND cmd;
+	SURFACE_FRAME_MARKER marker;
 	pixman_box32_t *rect, subrect;
 	int nrects, i;
 	int heightIncrement, remainingHeight, top;
@@ -320,18 +320,18 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p
 	if (!nrects)
 		return;
 
-	marker->frameId++;
-	marker->frameAction = SURFACECMD_FRAMEACTION_BEGIN;
-	update->SurfaceFrameMarker(peer->context, marker);
+	marker.frameId++;
+	marker.frameAction = SURFACECMD_FRAMEACTION_BEGIN;
+	update->SurfaceFrameMarker(peer->context, &marker);
 
-	memset(cmd, 0, sizeof(*cmd));
+	memset(&cmd, 0, sizeof(cmd));
 	SURFACE_BPP(cmd) = 32;
 	SURFACE_CODECID(cmd) = 0;
 
 	for (i = 0; i < nrects; i++, rect++) {
 		/*weston_log("rect(%d,%d, %d,%d)\n", rect->x1, rect->y1, rect->x2, rect->y2);*/
-		cmd->destLeft = rect->x1;
-		cmd->destRight = rect->x2;
+		cmd.destLeft = rect->x1;
+		cmd.destRight = rect->x2;
 		SURFACE_WIDTH(cmd) = rect->x2 - rect->x1;
 
 		heightIncrement = peer->settings->MultifragMaxRequestSize / (16 + SURFACE_WIDTH(cmd) * 4);
@@ -343,8 +343,8 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p
 
 		while (remainingHeight) {
 			   SURFACE_HEIGHT(cmd) = (remainingHeight > heightIncrement) ? heightIncrement : remainingHeight;
-			   cmd->destTop = top;
-			   cmd->destBottom = top + SURFACE_HEIGHT(cmd);
+			   cmd.destTop = top;
+			   cmd.destBottom = top + SURFACE_HEIGHT(cmd);
 			   SURFACE_BITMAP_DATA_LEN(cmd) = SURFACE_WIDTH(cmd) * SURFACE_HEIGHT(cmd) * 4;
 			   SURFACE_BITMAP_DATA(cmd) = (BYTE *)realloc(SURFACE_BITMAP_DATA(cmd), SURFACE_BITMAP_DATA_LEN(cmd));
 
@@ -353,15 +353,15 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p
 			   pixman_image_flipped_subrect(&subrect, image, SURFACE_BITMAP_DATA(cmd));
 
 			   /*weston_log("*  sending (%d,%d, %d,%d)\n", subrect.x1, subrect.y1, subrect.x2, subrect.y2); */
-			   update->SurfaceBits(peer->context, cmd);
+			   update->SurfaceBits(peer->context, &cmd);
 
 			   remainingHeight -= SURFACE_HEIGHT(cmd);
 			   top += SURFACE_HEIGHT(cmd);
 		}
 	}
 
-	marker->frameAction = SURFACECMD_FRAMEACTION_END;
-	update->SurfaceFrameMarker(peer->context, marker);
+	marker.frameAction = SURFACECMD_FRAMEACTION_END;
+	update->SurfaceFrameMarker(peer->context, &marker);
 }
 
 static void
@@ -956,7 +956,7 @@ xf_peer_activate(freerdp_peer* client)
 	pixman_box32_t box;
 	pixman_region32_t damage;
 	char seat_name[50];
-
+	POINTER_SYSTEM_UPDATE pointer_system;
 
 	peerCtx = (RdpPeerContext *)client->context;
 	b = peerCtx->rdpBackend;
@@ -1056,8 +1056,8 @@ xf_peer_activate(freerdp_peer* client)
 
 	/* disable pointer on the client side */
 	pointer = client->update->pointer;
-	pointer->pointer_system.type = SYSPTR_NULL;
-	pointer->PointerSystem(client->context, &pointer->pointer_system);
+	pointer_system.type = SYSPTR_NULL;
+	pointer->PointerSystem(client->context, &pointer_system);
 
 	/* sends a full refresh */
 	box.x1 = 0;
-- 
2.17.1



More information about the wayland-devel mailing list