<div dir="ltr">How does it make any sense to declare const on the return type of a function that doesn't return a pointer??? It's not returning by reference, it's returning a copy so const on the return type of the function means nothing.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 7, 2017 at 4:54 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Already used as such and annotated in a number of places.<br>
Should resolve -Wignored-qualifiers warnings, such as:<br>
<br>
src/intel/blorp/blorp_blit.c:<wbr>1857:8: warning: 'const' type qualifier on<br>
return type has no effect [-Wignored-qualifiers]<br>
<br>
Signed-off-by: Emil Velikov <<a href="mailto:emil.l.velikov@gmail.com">emil.l.velikov@gmail.com</a>><br>
---<br>
src/intel/blorp/blorp_blit.c | 4 ++--<br>
src/intel/isl/isl.c | 4 ++--<br>
src/intel/isl/isl.h | 2 +-<br>
3 files changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c<br>
index b89a112b8c..1d3b52d80e 100644<br>
--- a/src/intel/blorp/blorp_blit.c<br>
+++ b/src/intel/blorp/blorp_blit.c<br>
@@ -1358,7 +1358,7 @@ surf_get_intratile_offset_px(<wbr>struct brw_blorp_surface_info *info,<br>
uint32_t *tile_x_px, uint32_t *tile_y_px)<br>
{<br>
if (info->surf.msaa_layout == ISL_MSAA_LAYOUT_INTERLEAVED) {<br>
- struct isl_extent2d px_size_sa =<br>
+ const struct isl_extent2d px_size_sa =<br>
isl_get_interleaved_msaa_px_<wbr>size_sa(info->surf.samples);<br>
assert(info->tile_x_sa % px_size_sa.width == 0);<br>
assert(info->tile_y_sa % px_size_sa.height == 0);<br>
@@ -1678,7 +1678,7 @@ try_blorp_blit(struct blorp_batch *batch,<br>
* If it's UMS, then we have no choice but to set up the rendering<br>
* pipeline as multisampled.<br>
*/<br>
- struct isl_extent2d px_size_sa =<br>
+ const struct isl_extent2d px_size_sa =<br>
isl_get_interleaved_msaa_px_<wbr>size_sa(params->dst.surf.<wbr>samples);<br>
params->x0 = ROUND_DOWN_TO(params->x0, 2) * px_size_sa.width;<br>
params->y0 = ROUND_DOWN_TO(params->y0, 2) * px_size_sa.height;<br>
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
index 82ab68dc65..62aa31cf29 100644<br>
--- a/src/intel/isl/isl.c<br>
+++ b/src/intel/isl/isl.c<br>
@@ -329,7 +329,7 @@ isl_choose_msaa_layout(const struct isl_device *dev,<br>
}<br>
}<br>
<br>
-struct isl_extent2d<br>
+const struct isl_extent2d<br>
isl_get_interleaved_msaa_px_<wbr>size_sa(uint32_t samples)<br>
{<br>
assert(isl_is_pow2(samples));<br>
@@ -342,7 +342,7 @@ isl_get_interleaved_msaa_px_<wbr>size_sa(uint32_t samples)<br>
* MSFMT_DEPTH_STENCIL, W_L and H_L must be adjusted as follows before<br>
* proceeding: [...]<br>
*/<br>
- return (struct isl_extent2d) {<br>
+ return (const struct isl_extent2d) {<br>
.width = 1 << ((ffs(samples) - 0) / 2),<br>
.height = 1 << ((ffs(samples) - 1) / 2),<br>
};<br>
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h<br>
index eff7218748..e9074e526d 100644<br>
--- a/src/intel/isl/isl.h<br>
+++ b/src/intel/isl/isl.h<br>
@@ -1172,7 +1172,7 @@ isl_tiling_is_std_y(enum isl_tiling tiling)<br>
return (1u << tiling) & ISL_TILING_STD_Y_MASK;<br>
}<br>
<br>
-struct isl_extent2d ATTRIBUTE_CONST<br>
+const struct isl_extent2d ATTRIBUTE_CONST<br>
isl_get_interleaved_msaa_px_<wbr>size_sa(uint32_t samples);<br>
<br>
static inline bool<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>