mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 13:50:09 +01:00
nouveau/nvc0: silence maybe-uninitialized warning
gcc is not smart enough to see that
enum pipe_format dst_fmt;
...
switch (data_size) {
case 16:
dst_fmt = PIPE_FORMAT_R32G32B32A32_UINT;
...
break;
case 12:
/* RGB32 is not a valid RT format. This will be handled by the pushbuf
* uploader.
*/
break;
case 8:
dst_fmt = PIPE_FORMAT_R32G32_UINT;
...
break;
case 4:
dst_fmt = PIPE_FORMAT_R32_UINT;
...
break;
case 2:
dst_fmt = PIPE_FORMAT_R16_UINT;
...
break;
case 1:
dst_fmt = PIPE_FORMAT_R8_UINT;
break;
default:
assert(!"Unsupported element size");
return;
}
...
if (data_size == 12) {
...
return;
}
Does not result in dst_fmt being uninitialized when it is used so
lets just initialise it to silence the warning.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>
This commit is contained in:
parent
6bec54dd3e
commit
7ccf258063
1 changed files with 1 additions and 0 deletions
|
|
@ -514,6 +514,7 @@ nvc0_clear_buffer(struct pipe_context *pipe,
|
|||
/* RGB32 is not a valid RT format. This will be handled by the pushbuf
|
||||
* uploader.
|
||||
*/
|
||||
dst_fmt = PIPE_FORMAT_NONE; /* Init dst_fmt to silence gcc warning */
|
||||
break;
|
||||
case 8:
|
||||
dst_fmt = PIPE_FORMAT_R32G32_UINT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue