Mesa (master): mesa/main: Don't use ONCE_FLAG_INIT as a r-value.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Jun 11 12:35:42 UTC 2015


Module: Mesa
Branch: master
Commit: 9fed4f9bf5146af1fcd093422b39353845f2267a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9fed4f9bf5146af1fcd093422b39353845f2267a

Author: Jose Fonseca <jfonseca at vmware.com>
Date:   Thu Jun 11 13:32:21 2015 +0100

mesa/main: Don't use ONCE_FLAG_INIT as a r-value.

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 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index f7c9402..baeb1bf 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -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;
    }
 




More information about the mesa-commit mailing list