xf86drm.c: fix C99 warning
authorEleni Maria Stea <elene.mst@gmail.com>
Mon, 9 May 2022 11:56:11 +0000 (14:56 +0300)
committerEleni Maria Stea <elene.mst@gmail.com>
Mon, 9 May 2022 11:56:11 +0000 (14:56 +0300)
Moved declaration to the top to resolve C99 compliance warning.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
xf86drm.c

index 5933e4b..76fdfaa 100644 (file)
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -261,6 +261,7 @@ drmGetAfbcFormatModifierNameFromArm(uint64_t modifier, FILE *fp)
 static bool
 drmGetAfrcFormatModifierNameFromArm(uint64_t modifier, FILE *fp)
 {
+    bool scan_layout;
     for (unsigned int i = 0; i < 2; ++i) {
         uint64_t coding_unit_block =
           (modifier >> (i * 4)) & AFRC_FORMAT_MOD_CU_SIZE_MASK;
@@ -292,7 +293,7 @@ drmGetAfrcFormatModifierNameFromArm(uint64_t modifier, FILE *fp)
         }
     }
 
-    bool scan_layout =
+    scan_layout =
         (modifier & AFRC_FORMAT_MOD_LAYOUT_SCAN) == AFRC_FORMAT_MOD_LAYOUT_SCAN;
     if (scan_layout) {
         fprintf(fp, "SCAN");