sna: Suppress warning for freeing a "constant" string
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Jan 2014 12:18:05 +0000 (12:18 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Jan 2014 12:24:47 +0000 (12:24 +0000)
We allocated and own the string, so we can free it!

sna_display.c: In function 'sna_output_get_modes':
sna_display.c:2314:4: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
    free(current->name);

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_display.c

index 22f1841..2829af1 100644 (file)
@@ -2311,7 +2311,7 @@ sna_output_get_modes(xf86OutputPtr output)
        if (current && (current->name == NULL || *current->name == '\0')) {
                char *str = canonical_mode_name(current);
                if (str) {
-                       free(current->name);
+                       free((char *)current->name);
                        current->name = str;
                }
        }