[v4,7/8] radv: use cross platform implementation 'util_vsnprintf'

Submitted by andrey simiklit on Sept. 6, 2018, 2:43 p.m.

Details

Message ID 1536245039-22231-9-git-send-email-asimiklit.work@gmail.com
State New
Headers show
Series "mesa/util: add missing va_end() after va_copy()" ( rev: 11 ) in Mesa

Not browsing as part of any series.

Commit Message

andrey simiklit Sept. 6, 2018, 2:43 p.m.
From: Andrii Simiklit <andrii.simiklit@globallogic.com>

I guess it makes this implementation more portable.

Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
---
 src/amd/vulkan/radv_util.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_util.c b/src/amd/vulkan/radv_util.c
index 72bedc6..90d3824 100644
--- a/src/amd/vulkan/radv_util.c
+++ b/src/amd/vulkan/radv_util.c
@@ -33,6 +33,7 @@ 
 #include "vk_enum_to_str.h"
 
 #include "util/u_math.h"
+#include "util/u_string.h"
 
 /** Log an error message.  */
 void radv_printflike(1, 2)
@@ -81,7 +82,7 @@  void radv_printflike(3, 4)
 	char buffer[256];
 
 	va_start(ap, format);
-	vsnprintf(buffer, sizeof(buffer), format, ap);
+	util_vsnprintf(buffer, sizeof(buffer), format, ap);
 	va_end(ap);
 
 	fprintf(stderr, "%s:%d: FINISHME: %s\n", file, line, buffer);
@@ -103,7 +104,7 @@  __vk_errorf(struct radv_instance *instance, VkResult error, const char *file,
 
 	if (format) {
 		va_start(ap, format);
-		vsnprintf(buffer, sizeof(buffer), format, ap);
+		util_vsnprintf(buffer, sizeof(buffer), format, ap);
 		va_end(ap);
 
 		fprintf(stderr, "%s:%d: %s (%s)\n", file, line, buffer, error_str);