Move from sentinel-terminated slices to sentinel-terminated pointers ([:0] -> [*:0])
This commit is contained in:
parent
19db777449
commit
a03b65a76c
6 changed files with 205 additions and 205 deletions
|
|
@ -435,17 +435,17 @@ pub fn guiLoadIcons(fileName: [*c]const u8, loadIconsName: bool) [*c][*c]u8 {
|
|||
}
|
||||
|
||||
/// Tab Bar control, returns TAB to be closed or -1
|
||||
pub fn guiTabBar(bounds: Rectangle, text: [][:0]const u8, active: *i32) i32 {
|
||||
pub fn guiTabBar(bounds: Rectangle, text: [][*:0]const u8, active: *i32) i32 {
|
||||
return @as(i32, cdef.GuiTabBar(bounds, @as([*c][*c]const u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(active))));
|
||||
}
|
||||
|
||||
/// List View with extended parameters
|
||||
pub fn guiListViewEx(bounds: Rectangle, text: [][:0]const u8, scrollIndex: *i32, active: *i32, focus: *i32) i32 {
|
||||
pub fn guiListViewEx(bounds: Rectangle, text: [][*:0]const u8, scrollIndex: *i32, active: *i32, focus: *i32) i32 {
|
||||
return @as(i32, cdef.GuiListViewEx(bounds, @as([*c][*c]const u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(scrollIndex)), @as([*c]c_int, @ptrCast(active)), @as([*c]c_int, @ptrCast(focus))));
|
||||
}
|
||||
|
||||
/// Panel control, useful to group controls
|
||||
pub fn guiPanel(bounds: Rectangle, text: ?[:0]const u8) i32 {
|
||||
pub fn guiPanel(bounds: Rectangle, text: ?[*:0]const u8) i32 {
|
||||
var textFinal = @as([*c]const u8, 0);
|
||||
if (text) |textSure| {
|
||||
textFinal = @as([*c]const u8, @ptrCast(textSure));
|
||||
|
|
@ -454,7 +454,7 @@ pub fn guiPanel(bounds: Rectangle, text: ?[:0]const u8) i32 {
|
|||
}
|
||||
|
||||
/// Scroll Panel control
|
||||
pub fn guiScrollPanel(bounds: Rectangle, text: ?[:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32 {
|
||||
pub fn guiScrollPanel(bounds: Rectangle, text: ?[*:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32 {
|
||||
var textFinal = @as([*c]const u8, 0);
|
||||
if (text) |textSure| {
|
||||
textFinal = @as([*c]const u8, @ptrCast(textSure));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue