提交 b2a6c7b6 编写于 作者: P prr

8197546: Fix for 8171000 breaks Solaris + Linux builds

Summary: Move loop declarations to function scope in ReadRegionsInList() in multiVis.c
Reviewed-by: serb, jdv
上级 e20169a7
/* /*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -395,6 +395,8 @@ XRectangle bbox; /* bounding box of grabbed area */ ...@@ -395,6 +395,8 @@ XRectangle bbox; /* bounding box of grabbed area */
list_ptr regions;/* list of regions to read from */ list_ptr regions;/* list of regions to read from */
{ {
XImage *ximage ; XImage *ximage ;
image_region_type* reg;
int32_t rect;
ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL, ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL,
(uint32_t)width,(uint32_t)height,8,0); (uint32_t)width,(uint32_t)height,8,0);
...@@ -402,11 +404,11 @@ list_ptr regions;/* list of regions to read from */ ...@@ -402,11 +404,11 @@ list_ptr regions;/* list of regions to read from */
ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char)); ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char));
ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/ ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
for (image_region_type* reg = (image_region_type *) first_in_list( regions); reg; for (reg = (image_region_type *) first_in_list( regions); reg;
reg = (image_region_type *) next_in_list( regions)) reg = (image_region_type *) next_in_list( regions))
{ {
struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region); struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region);
for (int32_t rect = 0; rect < vis_reg->numRects; rect++) for (rect = 0; rect < vis_reg->numRects; rect++)
{ {
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
Intersect bbox with visible part of region giving src rect & output Intersect bbox with visible part of region giving src rect & output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册