fixing macos warning

This commit is contained in:
2023-11-14 07:22:38 +01:00
parent 02d2dbb1bd
commit 6c3db4a8db
2 changed files with 11 additions and 8 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:48:06 by maldavid #+# #+# */
/* Updated: 2023/04/23 13:07:56 by maldavid ### ########.fr */
/* Updated: 2023/11/14 07:14:57 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,15 +17,17 @@
#include "errors.h"
constexpr const int BUFFER_SIZE = 4096;
namespace mlx::core::error
{
void report(e_kind kind, std::string msg, ...)
{
char buffer[4096];
char buffer[BUFFER_SIZE];
va_list al;
va_start(al, msg);
std::vsprintf(buffer, msg.c_str(), al);
std::vsnprintf(buffer, BUFFER_SIZE, msg.c_str(), al);
va_end(al);
switch(kind)

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/08 18:55:57 by maldavid #+# #+# */
/* Updated: 2023/11/14 07:06:17 by maldavid ### ########.fr */
/* Updated: 2023/11/14 07:17:06 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -65,13 +65,14 @@ namespace mlx
bufferInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
_name = name;
std::string alloc_name = _name;
if(usage & VK_BUFFER_USAGE_INDEX_BUFFER_BIT)
_name.append("_index_buffer");
alloc_name.append("_index_buffer");
else if(usage & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)
_name.append("_vertex_buffer");
alloc_name.append("_vertex_buffer");
else if((usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) != 1)
_name.append("_buffer");
_allocation = Render_Core::get().getAllocator().createBuffer(&bufferInfo, &info, _buffer, _name.c_str());
alloc_name.append("_buffer");
_allocation = Render_Core::get().getAllocator().createBuffer(&bufferInfo, &info, _buffer, alloc_name.c_str());
_size = size;
}