mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: fix all -cstrict
warnings with gcc and clang (#9792)
This commit is contained in:
@@ -153,7 +153,7 @@ pub fn query_desc() C.sg_desc {
|
||||
|
||||
[inline]
|
||||
pub fn query_backend() Backend {
|
||||
return C.sg_query_backend()
|
||||
return Backend(C.sg_query_backend())
|
||||
}
|
||||
|
||||
[inline]
|
||||
@@ -226,27 +226,27 @@ pub fn query_pass_info(pass C.sg_pass) C.sg_pass_info {
|
||||
// get resource creation desc struct with their default values replaced
|
||||
[inline]
|
||||
pub fn query_buffer_defaults(desc &C.sg_buffer) C.sg_buffer_desc {
|
||||
return C.sg_query_buffer_defaults(desc)
|
||||
return C.sg_query_buffer_defaults(unsafe { &C.sg_buffer_desc(desc) })
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn query_image_defaults(desc &C.sg_image) C.sg_image_desc {
|
||||
return C.sg_query_image_defaults(desc)
|
||||
return C.sg_query_image_defaults(unsafe { &C.sg_image_desc(desc) })
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn query_shader_defaults(desc &C.sg_shader) C.sg_shader_desc {
|
||||
return C.sg_query_shader_defaults(desc)
|
||||
return C.sg_query_shader_defaults(unsafe { &C.sg_shader_desc(desc) })
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn query_pipeline_defaults(desc &C.sg_pipeline) C.sg_pipeline_desc {
|
||||
return C.sg_query_pipeline_defaults(desc)
|
||||
return C.sg_query_pipeline_defaults(unsafe { &C.sg_pipeline_desc(desc) })
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn query_pass_defaults(desc &C.sg_pass) C.sg_pass_desc {
|
||||
return C.sg_query_pass_defaults(desc)
|
||||
return C.sg_query_pass_defaults(unsafe { &C.sg_pass_desc(desc) })
|
||||
}
|
||||
|
||||
/* rendering contexts (optional) */
|
||||
|
@@ -58,11 +58,11 @@ fn C.sg_query_pipeline_info(pip C.sg_pipeline) C.sg_pipeline_info
|
||||
fn C.sg_query_pass_info(pass C.sg_pass) C.sg_pass_info
|
||||
|
||||
// get resource creation desc struct with their default values replaced
|
||||
fn C.sg_query_buffer_defaults(desc &C.sg_buffer) C.sg_buffer_desc
|
||||
fn C.sg_query_image_defaults(desc &C.sg_image) C.sg_image_desc
|
||||
fn C.sg_query_shader_defaults(desc &C.sg_shader) C.sg_shader_desc
|
||||
fn C.sg_query_pipeline_defaults(desc &C.sg_pipeline) C.sg_pipeline_desc
|
||||
fn C.sg_query_pass_defaults(desc &C.sg_pass) C.sg_pass_desc
|
||||
fn C.sg_query_buffer_defaults(desc &C.sg_buffer_desc) C.sg_buffer_desc
|
||||
fn C.sg_query_image_defaults(desc &C.sg_image_desc) C.sg_image_desc
|
||||
fn C.sg_query_shader_defaults(desc &C.sg_shader_desc) C.sg_shader_desc
|
||||
fn C.sg_query_pipeline_defaults(desc &C.sg_pipeline_desc) C.sg_pipeline_desc
|
||||
fn C.sg_query_pass_defaults(desc &C.sg_pass_desc) C.sg_pass_desc
|
||||
|
||||
/* rendering contexts (optional) */
|
||||
fn C.sg_setup_context() C.sg_context
|
||||
|
@@ -161,23 +161,23 @@ pub mut:
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_desc) set_vert_src(src string) &C.sg_shader_desc {
|
||||
desc.vs.source = src.str
|
||||
desc.vs.source = &char(src.str)
|
||||
return desc
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_desc) set_frag_src(src string) &C.sg_shader_desc {
|
||||
desc.fs.source = src.str
|
||||
desc.fs.source = &char(src.str)
|
||||
return desc
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_desc) set_vert_image(index int, name string) &C.sg_shader_desc {
|
||||
desc.vs.images[index].name = name.str
|
||||
desc.vs.images[index].name = &char(name.str)
|
||||
desc.vs.images[index].image_type = ._2d
|
||||
return desc
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_desc) set_frag_image(index int, name string) &C.sg_shader_desc {
|
||||
desc.fs.images[index].name = name.str
|
||||
desc.fs.images[index].name = &char(name.str)
|
||||
desc.fs.images[index].image_type = ._2d
|
||||
return desc
|
||||
}
|
||||
@@ -193,13 +193,13 @@ pub fn (mut desc C.sg_shader_desc) set_frag_uniform_block_size(block_index int,
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_desc) set_vert_uniform(block_index int, uniform_index int, name string, @type UniformType, array_count int) &C.sg_shader_desc {
|
||||
desc.vs.uniform_blocks[block_index].uniforms[uniform_index].name = name.str
|
||||
desc.vs.uniform_blocks[block_index].uniforms[uniform_index].name = &char(name.str)
|
||||
desc.vs.uniform_blocks[block_index].uniforms[uniform_index].@type = @type
|
||||
return desc
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_desc) set_frag_uniform(block_index int, uniform_index int, name string, @type UniformType, array_count int) &C.sg_shader_desc {
|
||||
desc.fs.uniform_blocks[block_index].uniforms[uniform_index].name = name.str
|
||||
desc.fs.uniform_blocks[block_index].uniforms[uniform_index].name = &char(name.str)
|
||||
desc.fs.uniform_blocks[block_index].uniforms[uniform_index].@type = @type
|
||||
return desc
|
||||
}
|
||||
@@ -225,7 +225,7 @@ pub mut:
|
||||
}
|
||||
|
||||
pub fn (mut desc C.sg_shader_stage_desc) set_image(index int, name string) C.sg_shader_stage_desc {
|
||||
desc.images[index].name = name.str
|
||||
desc.images[index].name = &char(name.str)
|
||||
desc.images[index].image_type = ._2d
|
||||
return *desc
|
||||
}
|
||||
|
@@ -128,14 +128,14 @@ pub fn frame_count() u64 {
|
||||
|
||||
// write string into clipboard
|
||||
[inline]
|
||||
pub fn set_clipboard_string(str byteptr) {
|
||||
pub fn set_clipboard_string(str &char) {
|
||||
C.sapp_set_clipboard_string(str)
|
||||
}
|
||||
|
||||
// read string from clipboard (usually during SAPP_EVENTTYPE_CLIPBOARD_PASTED)
|
||||
[inline]
|
||||
pub fn get_clipboard_string() byteptr {
|
||||
return C.sapp_get_clipboard_string()
|
||||
pub fn get_clipboard_string() &char {
|
||||
return &char(C.sapp_get_clipboard_string())
|
||||
}
|
||||
|
||||
// special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub)
|
||||
@@ -160,65 +160,65 @@ pub fn html5_ask_leave_site(ask bool) {
|
||||
// Metal: get ARC-bridged pointer to Metal device object
|
||||
[inline]
|
||||
pub fn metal_get_device() voidptr {
|
||||
return C.sapp_metal_get_device()
|
||||
return voidptr(C.sapp_metal_get_device())
|
||||
}
|
||||
|
||||
// Metal: get ARC-bridged pointer to this frame's renderpass descriptor
|
||||
[inline]
|
||||
pub fn metal_get_renderpass_descriptor() voidptr {
|
||||
return C.sapp_metal_get_renderpass_descriptor()
|
||||
return voidptr(C.sapp_metal_get_renderpass_descriptor())
|
||||
}
|
||||
|
||||
// Metal: get ARC-bridged pointer to current drawable
|
||||
[inline]
|
||||
pub fn metal_get_drawable() voidptr {
|
||||
return C.sapp_metal_get_drawable()
|
||||
return voidptr(C.sapp_metal_get_drawable())
|
||||
}
|
||||
|
||||
// macOS: get ARC-bridged pointer to macOS NSWindow
|
||||
[inline]
|
||||
pub fn macos_get_window() voidptr {
|
||||
return C.sapp_macos_get_window()
|
||||
return voidptr(C.sapp_macos_get_window())
|
||||
}
|
||||
|
||||
// iOS: get ARC-bridged pointer to iOS UIWindow
|
||||
[inline]
|
||||
pub fn ios_get_window() voidptr {
|
||||
return C.sapp_ios_get_window()
|
||||
return voidptr(C.sapp_ios_get_window())
|
||||
}
|
||||
|
||||
// D3D11: get pointer to ID3D11Device object
|
||||
[inline]
|
||||
pub fn d3d11_get_device() voidptr {
|
||||
return C.sapp_d3d11_get_device()
|
||||
return voidptr(C.sapp_d3d11_get_device())
|
||||
}
|
||||
|
||||
// D3D11: get pointer to ID3D11DeviceContext object
|
||||
[inline]
|
||||
pub fn d3d11_get_device_context() voidptr {
|
||||
return C.sapp_d3d11_get_device_context()
|
||||
return voidptr(C.sapp_d3d11_get_device_context())
|
||||
}
|
||||
|
||||
// D3D11: get pointer to ID3D11RenderTargetView object
|
||||
[inline]
|
||||
pub fn d3d11_get_render_target_view() voidptr {
|
||||
return C.sapp_d3d11_get_render_target_view()
|
||||
return voidptr(C.sapp_d3d11_get_render_target_view())
|
||||
}
|
||||
|
||||
// D3D11: get pointer to ID3D11DepthStencilView
|
||||
[inline]
|
||||
pub fn d3d11_get_depth_stencil_view() voidptr {
|
||||
return C.sapp_d3d11_get_depth_stencil_view()
|
||||
return voidptr(C.sapp_d3d11_get_depth_stencil_view())
|
||||
}
|
||||
|
||||
// Win32: get the HWND window handle
|
||||
[inline]
|
||||
pub fn win32_get_hwnd() voidptr {
|
||||
return C.sapp_win32_get_hwnd()
|
||||
return voidptr(C.sapp_win32_get_hwnd())
|
||||
}
|
||||
|
||||
// Android: get native activity handle
|
||||
[inline]
|
||||
pub fn android_get_native_activity() voidptr {
|
||||
return C.sapp_android_get_native_activity()
|
||||
return voidptr(C.sapp_android_get_native_activity())
|
||||
}
|
||||
|
Reference in New Issue
Block a user