Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/sdl2.zig
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extern fn SDL_LogResetPriorities() void;
pub fn log(comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -174,7 +174,7 @@ extern fn SDL_Log(fmt: [*:0]const u8, ...) void;
pub fn logVerbose(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -192,7 +192,7 @@ extern fn SDL_LogVerbose(category: c_int, fmt: [*:0]const u8, ...) void;
pub fn logDebug(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -210,7 +210,7 @@ extern fn SDL_LogDebug(category: c_int, fmt: [*:0]const u8, ...) void;
pub fn logInfo(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -228,7 +228,7 @@ extern fn SDL_LogInfo(category: c_int, fmt: [*:0]const u8, ...) void;
pub fn logWarn(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -246,7 +246,7 @@ extern fn SDL_LogWarn(category: c_int, fmt: [*:0]const u8, ...) void;
pub fn logError(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -264,7 +264,7 @@ extern fn SDL_LogError(category: c_int, fmt: [*:0]const u8, ...) void;
pub fn logCritical(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -282,7 +282,7 @@ extern fn SDL_LogCritical(category: c_int, fmt: [*:0]const u8, ...) void;
pub fn logMessage(category: LogCategory, priority: LogPriority, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand Down
18 changes: 9 additions & 9 deletions src/sdl3.zig
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ extern fn SDL_SetLogPriorityPrefix(priority: LogPriority, prefix: [*c]const u8)
pub fn log(comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -369,7 +369,7 @@ extern fn SDL_Log(fmt: [*c]const u8, ...) void;
pub fn logTrace(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -387,7 +387,7 @@ extern fn SDL_LogTrace(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logVerbose(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -405,7 +405,7 @@ extern fn SDL_LogVerbose(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logDebug(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -423,7 +423,7 @@ extern fn SDL_LogDebug(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logInfo(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -441,7 +441,7 @@ extern fn SDL_LogInfo(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logWarn(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -459,7 +459,7 @@ extern fn SDL_LogWarn(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logError(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -477,7 +477,7 @@ extern fn SDL_LogError(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logCritical(category: LogCategory, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand All @@ -495,7 +495,7 @@ extern fn SDL_LogCritical(category: c_int, fmt: [*c]const u8, ...) void;
pub fn logMessage(category: LogCategory, priority: LogPriority, comptime fmt: []const u8, args: anytype) void {
assert(fmt.len > 0 and fmt.len < max_log_message - 1);
var buf: [max_log_message]u8 = undefined;
const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) {
const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => {
SDL_LogError(
@intFromEnum(LogCategory.assert),
Expand Down