From c0e2b9b1e2f2bacf64a10459ef0b52eba762b3a2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 5 Apr 2021 20:55:03 +0300 Subject: [PATCH] ci: fix some of `v test-cleancode` 2 --- vlib/builtin/utf8.v | 2 +- vlib/dl/dl_windows.c.v | 2 +- vlib/gg/gg_android.c.v | 6 +++--- vlib/gg/image.v | 2 +- vlib/math/big/big.v | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vlib/builtin/utf8.v b/vlib/builtin/utf8.v index 0d26f9cb56..76f561f2f2 100644 --- a/vlib/builtin/utf8.v +++ b/vlib/builtin/utf8.v @@ -21,7 +21,7 @@ pub fn utf32_to_str_no_malloc(code u32, buf voidptr) string { icode := int(code) // Prevents doing casts everywhere mut res := '' unsafe { - mut buffer := byteptr(buf) + mut buffer := &byte(buf) if icode <= 127 { // 0x7F buffer[0] = byte(icode) diff --git a/vlib/dl/dl_windows.c.v b/vlib/dl/dl_windows.c.v index b33a5970f1..58d41aee4b 100644 --- a/vlib/dl/dl_windows.c.v +++ b/vlib/dl/dl_windows.c.v @@ -7,7 +7,7 @@ pub const ( 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 diff --git a/vlib/gg/gg_android.c.v b/vlib/gg/gg_android.c.v index d90216a589..23450f2b87 100644 --- a/vlib/gg/gg_android.c.v +++ b/vlib/gg/gg_android.c.v @@ -19,10 +19,10 @@ pub: callbacks voidptr // Pointer to the callback function table of the native application. (struct ANativeActivityCallbacks *) clazz voidptr // The NativeActivity object handle. 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. - internalDataPath charptr // 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). + internalDataPath &char // Path to this application's internal data directory. + 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. vm voidptr // The global handle on the process's Java VM } diff --git a/vlib/gg/image.v b/vlib/gg/image.v index e969dfe703..5deab213c4 100644 --- a/vlib/gg/image.v +++ b/vlib/gg/image.v @@ -119,7 +119,7 @@ fn create_image(file string) Image { 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{} } mut img := Image{ width: stb_img.width diff --git a/vlib/math/big/big.v b/vlib/math/big/big.v index fba8bc398d..465960fd0d 100644 --- a/vlib/math/big/big.v +++ b/vlib/math/big/big.v @@ -19,9 +19,9 @@ fn C.bignum_from_int(n &Number, i u64) 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 fn C.bignum_add(a &Number, b &Number, c &Number)