Mesa (master): kutil/queue: use util_snprintf() in util_queue_init

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 2 07:07:18 UTC 2018


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

Author: Andres Gomez <agomez at igalia.com>
Date:   Wed Aug  1 15:55:51 2018 +0300

kutil/queue: use util_snprintf() in util_queue_init

Instead of plain snprintf(). To fix the MSVC 2013 build:

  Compiling src\util\u_queue.c ...
u_queue.c
src\util\u_queue.c(325) : warning C4013: 'snprintf' undefined; assuming extern returning int

...

mesautil.lib(u_queue.obj) : error LNK2001: unresolved external symbol _snprintf
scons: building terminated because of errors.

Fixes: b238e33bc9d ("kutil/queue: add a process name into a thread name")
Cc: Marek Olšák <marek.olsak at amd.com>
Cc: Brian Paul <brianp at vmware.com>
Cc: Roland Scheidegger <sroland at vmware.com>
Cc: Timothy Arceri <tarceri at itsqueeze.com>
Cc: Eric Engestrom <eric.engestrom at intel.com>
Signed-off-by: Andres Gomez <agomez at igalia.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/util/u_queue.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/u_queue.c b/src/util/u_queue.c
index 4ce1af518b..22d2cdd0fa 100644
--- a/src/util/u_queue.c
+++ b/src/util/u_queue.c
@@ -322,10 +322,10 @@ util_queue_init(struct util_queue *queue,
    memset(queue, 0, sizeof(*queue));
 
    if (process_len) {
-      snprintf(queue->name, sizeof(queue->name), "%.*s:%s",
-               process_len, process_name, name);
+      util_snprintf(queue->name, sizeof(queue->name), "%.*s:%s",
+                    process_len, process_name, name);
    } else {
-      snprintf(queue->name, sizeof(queue->name), "%s", name);
+      util_snprintf(queue->name, sizeof(queue->name), "%s", name);
    }
 
    queue->flags = flags;




More information about the mesa-commit mailing list