0001-cogl-path-add-explicit-cast-to-avoid-an-incompatible.patch 6.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From 69690b0fdff43cdf6ab1718cd86396de3b27081f Mon Sep 17 00:00:00 2001
  2. From: Yoann Congal <yoann.congal@smile.fr>
  3. Date: Tue, 6 May 2025 00:00:38 +0200
  4. Subject: [PATCH] cogl-path: add explicit cast to avoid an
  5. incompatible-pointer-types error
  6. Callbacks declarations are not compatible with gluTessCallback(...,
  7. _GLUfuncptr CallBackFunc) under gcc15. Use an intermediary (void *) cast
  8. to workaround the incompatible-pointer-types error.
  9. This is safe to do because inside gluTessCallback(), function pointers
  10. are cast back to their proper prototypes.
  11. This corrects these 4 errors:
  12. |../../cogl-1.22.8/cogl-path/cogl-path.c: In function '_cogl_path_build_fill_attribute_buffer':
  13. |../../cogl-1.22.8/cogl-path/cogl-path.c:1361:20: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types]
  14. | 1361 | _cogl_path_tesselator_begin);
  15. | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  16. | | |
  17. | | void (*)(GLenum, CoglPathTesselator *) {aka void (*)(unsigned int, struct _CoglPathTesselator *)}
  18. |In file included from ../../cogl-1.22.8/cogl-path/cogl-path.c:49:
  19. |../../cogl-1.22.8/cogl-path/tesselator/tesselator.h:57:70: note: expected 'void (*)(void)' but argument is of type 'void (*)(GLenum, CoglPathTesselator *)' {aka 'void (*)(unsigned int, struct _CoglPathTesselator *)'}
  20. | 57 | void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
  21. | | ~~~~~~~~~~~~^~~~~~~~~~~~
  22. |../../cogl-1.22.8/cogl-path/cogl-path.c:1094:1: note: '_cogl_path_tesselator_begin' declared here
  23. | 1094 | _cogl_path_tesselator_begin (GLenum type,
  24. | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. |../../cogl-1.22.8/cogl-path/cogl-path.c:1363:20: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types]
  26. | 1363 | _cogl_path_tesselator_vertex);
  27. | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. | | |
  29. | | void (*)(void *, CoglPathTesselator *) {aka void (*)(void *, struct _CoglPathTesselator *)}
  30. |../../cogl-1.22.8/cogl-path/tesselator/tesselator.h:57:70: note: expected 'void (*)(void)' but argument is of type 'void (*)(void *, CoglPathTesselator *)' {aka 'void (*)(void *, struct _CoglPathTesselator *)'}
  31. | 57 | void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
  32. | | ~~~~~~~~~~~~^~~~~~~~~~~~
  33. |../../cogl-1.22.8/cogl-path/cogl-path.c:1164:1: note: '_cogl_path_tesselator_vertex' declared here
  34. | 1164 | _cogl_path_tesselator_vertex (void *vertex_data,
  35. | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. |../../cogl-1.22.8/cogl-path/cogl-path.c:1365:20: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types]
  37. | 1365 | _cogl_path_tesselator_end);
  38. | | ^~~~~~~~~~~~~~~~~~~~~~~~~
  39. | | |
  40. | | void (*)(CoglPathTesselator *) {aka void (*)(struct _CoglPathTesselator *)}
  41. |../../cogl-1.22.8/cogl-path/tesselator/tesselator.h:57:70: note: expected 'void (*)(void)' but argument is of type 'void (*)(CoglPathTesselator *)' {aka 'void (*)(struct _CoglPathTesselator *)'}
  42. | 57 | void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
  43. | | ~~~~~~~~~~~~^~~~~~~~~~~~
  44. |../../cogl-1.22.8/cogl-path/cogl-path.c:1223:1: note: '_cogl_path_tesselator_end' declared here
  45. | 1223 | _cogl_path_tesselator_end (CoglPathTesselator *tess)
  46. | | ^~~~~~~~~~~~~~~~~~~~~~~~~
  47. |../../cogl-1.22.8/cogl-path/cogl-path.c:1367:20: error: passing argument 3 of 'gluTessCallback' from incompatible pointer type [-Wincompatible-pointer-types]
  48. | 1367 | _cogl_path_tesselator_combine);
  49. | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  50. | | |
  51. | | void (*)(double *, void **, float *, void **, CoglPathTesselator *) {aka void (*)(double *, void **, float *, void **, struct _CoglPathTesselator *)}
  52. |../../cogl-1.22.8/cogl-path/tesselator/tesselator.h:57:70: note: expected 'void (*)(void)' but argument is of type 'void (*)(double *, void **, float *, void **, CoglPathTesselator *)' {aka 'void (*)(double *, void **, float *, void **, struct _CoglPathTesselator *)'}
  53. | 57 | void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
  54. | | ~~~~~~~~~~~~^~~~~~~~~~~~
  55. |../../cogl-1.22.8/cogl-path/cogl-path.c:1229:1: note: '_cogl_path_tesselator_combine' declared here
  56. | 1229 | _cogl_path_tesselator_combine (double coords[3],
  57. | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. |make[3]: *** [Makefile:905: libcogl_path_la-cogl-path.lo] Error 1
  59. Upstream-Status: Inactive-Upstream [lastcommit: 2021-05-02]
  60. Gitlab instance is redirected to https://gitlab.gnome.org/Archive/cogl
  61. with a notice: "This is an archived project. Repository and other
  62. project resources are read-only."
  63. Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
  64. ---
  65. cogl-path/cogl-path.c | 8 ++++----
  66. 1 file changed, 4 insertions(+), 4 deletions(-)
  67. diff --git a/cogl-path/cogl-path.c b/cogl-path/cogl-path.c
  68. index 2b4b3c6..f87ea4a 100644
  69. --- a/cogl-path/cogl-path.c
  70. +++ b/cogl-path/cogl-path.c
  71. @@ -1358,13 +1358,13 @@ _cogl_path_build_fill_attribute_buffer (CoglPath *path)
  72. gluTessNormal (tess.glu_tess, 0.0, 0.0, 1.0);
  73. gluTessCallback (tess.glu_tess, GLU_TESS_BEGIN_DATA,
  74. - _cogl_path_tesselator_begin);
  75. + (void *) _cogl_path_tesselator_begin);
  76. gluTessCallback (tess.glu_tess, GLU_TESS_VERTEX_DATA,
  77. - _cogl_path_tesselator_vertex);
  78. + (void *) _cogl_path_tesselator_vertex);
  79. gluTessCallback (tess.glu_tess, GLU_TESS_END_DATA,
  80. - _cogl_path_tesselator_end);
  81. + (void *) _cogl_path_tesselator_end);
  82. gluTessCallback (tess.glu_tess, GLU_TESS_COMBINE_DATA,
  83. - _cogl_path_tesselator_combine);
  84. + (void *) _cogl_path_tesselator_combine);
  85. gluTessBeginPolygon (tess.glu_tess, &tess);