mesa/main: Don't use ONCE_FLAG_INIT as a r-value.
authorJose Fonseca <jfonseca@vmware.com>
Thu, 11 Jun 2015 12:32:21 +0000 (13:32 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Thu, 11 Jun 2015 12:35:23 +0000 (13:35 +0100)
It should only be used as an initializer expression.

Trivial, and fixes Windows builds.

Nevertheless, overwriting an once_flag like this seems dangerous and
should be revised.

src/mesa/main/formats.c

index f7c94024f65938fa720edb67ebd207ecaeec51d7..baeb1bfe5deda82a6a16de6d51e582eb1ca54376 100644 (file)
@@ -438,7 +438,8 @@ _mesa_format_from_array_format(uint32_t array_format)
    call_once(&format_array_format_table_exists, format_array_format_table_init);
 
    if (!format_array_format_table) {
-      format_array_format_table_exists = ONCE_FLAG_INIT;
+      static const once_flag once_flag_init = ONCE_FLAG_INIT;
+      format_array_format_table_exists = once_flag_init;
       return MESA_FORMAT_NONE;
    }