The code is currently correct C99, which is what the Xorg code is written in.
This patch is only needed for forks like TigerVNC which use this code in C++
programs. I don't mind accepting small patches like this, especially since I
made the exact same patch to the Solaris packages so we can build TigerVNC,
but we're not going to guarantee our C code will always be portable to C++.
Reviewed-by: Alan Coopersmith <[email protected]>
-alan-
On 12/30/14 04:37 AM, [email protected] wrote:
From: Helio Chissini de Castro <[email protected]>
Missing cast break compilation when base code used for third party
applications, like tigervnc.
Usage of -fpermissive solves compilation issue but can mask the problem.
Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=1177687
Signed-off-by: Helio Chissini de Castro <[email protected]>
---
include/regionstr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/regionstr.h b/include/regionstr.h
index 079375d..1032358 100644
--- a/include/regionstr.h
+++ b/include/regionstr.h
@@ -144,7 +144,7 @@ RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size)
size_t rgnSize;
(_pReg)->extents = RegionEmptyBox;
if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
- (((_pReg)->data = malloc(rgnSize)) != NULL)) {
+ (((_pReg)->data = (RegDataPtr) malloc(rgnSize)) != NULL)) {
(_pReg)->data->size = (_size);
(_pReg)->data->numRects = 0;
}
--
-Alan Coopersmith- [email protected]
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel