1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: fix some of v test-cleancode 2

This commit is contained in:
Delyan Angelov 2021-04-05 20:55:03 +03:00
parent fec89c7efb
commit c0e2b9b1e2
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
5 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ pub fn utf32_to_str_no_malloc(code u32, buf voidptr) string {
icode := int(code) // Prevents doing casts everywhere icode := int(code) // Prevents doing casts everywhere
mut res := '' mut res := ''
unsafe { unsafe {
mut buffer := byteptr(buf) mut buffer := &byte(buf)
if icode <= 127 { if icode <= 127 {
// 0x7F // 0x7F
buffer[0] = byte(icode) buffer[0] = byte(icode)

View File

@ -7,7 +7,7 @@ pub const (
fn C.LoadLibrary(libfilename &u16) voidptr fn C.LoadLibrary(libfilename &u16) voidptr
fn C.GetProcAddress(handle voidptr, procname byteptr) voidptr fn C.GetProcAddress(handle voidptr, procname &byte) voidptr
fn C.FreeLibrary(handle voidptr) bool fn C.FreeLibrary(handle voidptr) bool

View File

@ -19,10 +19,10 @@ pub:
callbacks voidptr // Pointer to the callback function table of the native application. (struct ANativeActivityCallbacks *) callbacks voidptr // Pointer to the callback function table of the native application. (struct ANativeActivityCallbacks *)
clazz voidptr // The NativeActivity object handle. clazz voidptr // The NativeActivity object handle.
env voidptr // JNI context for the main thread of the app. env voidptr // JNI context for the main thread of the app.
externalDataPath charptr // Path to this application's external (removable/mountable) data directory. externalDataPath &char // Path to this application's external (removable/mountable) data directory.
instance voidptr // This is the native instance of the application. instance voidptr // This is the native instance of the application.
internalDataPath charptr // Path to this application's internal data directory. internalDataPath &char // Path to this application's internal data directory.
obbPath charptr // Available starting with Honeycomb: path to the directory containing the application's OBB files (if any). obbPath &char // Available starting with Honeycomb: path to the directory containing the application's OBB files (if any).
sdkVersion int // The platform's SDK version code. sdkVersion int // The platform's SDK version code.
vm voidptr // The global handle on the process's Java VM vm voidptr // The global handle on the process's Java VM
} }

View File

@ -119,7 +119,7 @@ fn create_image(file string) Image {
return img return img
} }
pub fn (mut ctx Context) create_image_from_memory(buf byteptr, bufsize int) Image { pub fn (mut ctx Context) create_image_from_memory(buf &byte, bufsize int) Image {
stb_img := stbi.load_from_memory(buf, bufsize) or { return Image{} } stb_img := stbi.load_from_memory(buf, bufsize) or { return Image{} }
mut img := Image{ mut img := Image{
width: stb_img.width width: stb_img.width

View File

@ -19,9 +19,9 @@ fn C.bignum_from_int(n &Number, i u64)
fn C.bignum_to_int(n &Number) int fn C.bignum_to_int(n &Number) int
fn C.bignum_from_string(n &Number, s byteptr, nbytes int) fn C.bignum_from_string(n &Number, s &byte, nbytes int)
fn C.bignum_to_string(n &Number, s byteptr, maxsize int) fn C.bignum_to_string(n &Number, s &byte, maxsize int)
// c = a + b // c = a + b
fn C.bignum_add(a &Number, b &Number, c &Number) fn C.bignum_add(a &Number, b &Number, c &Number)