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:
Timothy Arceri 2020-07-06 13:20:04 +10:00 committed by Marge Bot
parent 6bec54dd3e
commit 7ccf258063

View file

@ -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;