Skip to content

Commit fbb9e65

Browse files
committed
all: ~500 more byte=>u8
1 parent ae6a25f commit fbb9e65

File tree

148 files changed

+545
-495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+545
-495
lines changed

cmd/tools/vast/cjson.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn C.cJSON_CreateNull() &C.cJSON
2424

2525
// fn C.cJSON_CreateNumber() &C.cJSON
2626
// fn C.cJSON_CreateString() &C.cJSON
27-
fn C.cJSON_CreateRaw(&byte) &C.cJSON
27+
fn C.cJSON_CreateRaw(&u8) &C.cJSON
2828

2929
fn C.cJSON_IsInvalid(voidptr) bool
3030

@@ -45,13 +45,13 @@ fn C.cJSON_IsObject(voidptr) bool
4545

4646
fn C.cJSON_IsRaw(voidptr) bool
4747

48-
fn C.cJSON_AddItemToObject(voidptr, &byte, voidptr)
48+
fn C.cJSON_AddItemToObject(voidptr, &u8, voidptr)
4949

5050
fn C.cJSON_AddItemToArray(voidptr, voidptr)
5151

5252
fn C.cJSON_Delete(voidptr)
5353

54-
fn C.cJSON_Print(voidptr) &byte
54+
fn C.cJSON_Print(voidptr) &u8
5555

5656
[inline]
5757
fn create_object() &C.cJSON {

examples/sokol/01_cubes/cube.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn destroy_texture(sg_img gfx.Image) {
6868
}
6969

7070
// Use only if usage: .dynamic is enabled
71-
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &byte) {
71+
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &u8) {
7272
sz := w * h * 4
7373
mut tmp_sbc := gfx.ImageData{}
7474
tmp_sbc.subimage[0][0] = gfx.Range{

examples/sokol/06_obj_viewer/modules/obj/rend.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import stbi
1818
/******************************************************************************
1919
* Texture functions
2020
******************************************************************************/
21-
pub fn create_texture(w int, h int, buf &byte) gfx.Image {
21+
pub fn create_texture(w int, h int, buf &u8) gfx.Image {
2222
sz := w * h * 4
2323
mut img_desc := gfx.ImageDesc{
2424
width: w

examples/sokol/particles/modules/particle/color.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module particle
55
// * Color
66
pub struct Color {
77
mut:
8-
r byte
9-
g byte
10-
b byte
11-
a byte
8+
r u8
9+
g u8
10+
b u8
11+
a u8
1212
}

examples/sokol/sounds/melody.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn graphics_frame(mut state AppState) {
6161
}
6262

6363
[inline]
64-
fn (mut state AppState) bsample(idx int) byte {
64+
fn (mut state AppState) bsample(idx int) u8 {
6565
return u8(127 + state.frames[(state.gframe + idx) & 2047] * 128)
6666
}
6767

examples/sokol/sounds/wav_player.v

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ struct RIFFChunkHeader {
104104
}
105105

106106
struct RIFFFormat {
107-
format_tag u16 // PCM = 1; Values other than 1 indicate some form of compression.
108-
nchannels u16 // Nc ; 1 = mono ; 2 = stereo
109-
sample_rate u32 // F
110-
avg_bytes_per_second u32 // F * M*Nc
111-
nblock_align u16 // M*Nc
112-
bits_per_sample u16 // 8 * M
113-
cbsize u16 // Size of the extension: 22
114-
valid_bits_per_sample u16 // at most 8*M
115-
channel_mask u32 // Speaker position mask
107+
format_tag u16 // PCM = 1; Values other than 1 indicate some form of compression.
108+
nchannels u16 // Nc ; 1 = mono ; 2 = stereo
109+
sample_rate u32 // F
110+
avg_bytes_per_second u32 // F * M*Nc
111+
nblock_align u16 // M*Nc
112+
bits_per_sample u16 // 8 * M
113+
cbsize u16 // Size of the extension: 22
114+
valid_bits_per_sample u16 // at most 8*M
115+
channel_mask u32 // Speaker position mask
116116
sub_format [16]u8 // GUID
117117
}
118118

examples/viewer/view.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fn destroy_texture(sg_img gfx.Image) {
144144
}
145145

146146
// Use only if: .dynamic is enabled
147-
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &byte) {
147+
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &u8) {
148148
sz := w * h * 4
149149
mut tmp_sbc := gfx.ImageData{}
150150
tmp_sbc.subimage[0][0] = gfx.Range{

vlib/arrays/arrays_test.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ fn test_copy() {
283283
}
284284

285285
fn test_can_copy_bits() {
286-
assert can_copy_bits<byte>()
286+
assert can_copy_bits<u8>()
287287
assert can_copy_bits<int>()
288288
assert can_copy_bits<voidptr>()
289-
assert can_copy_bits<&byte>()
289+
assert can_copy_bits<&u8>()
290290
// autofree needs to intercept assign
291291
assert !can_copy_bits<string>()
292292
assert !can_copy_bits<[]int>()

vlib/builtin/array.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,8 @@ pub fn (mut a array) reverse_in_place() {
642642
mut tmp_value := malloc(a.element_size)
643643
for i in 0 .. a.len / 2 {
644644
vmemcpy(tmp_value, &u8(a.data) + i * a.element_size, a.element_size)
645-
vmemcpy(&u8(a.data) + i * a.element_size, &u8(a.data) +
646-
(a.len - 1 - i) * a.element_size, a.element_size)
645+
vmemcpy(&u8(a.data) + i * a.element_size, &u8(a.data) + (a.len - 1 - i) * a.element_size,
646+
a.element_size)
647647
vmemcpy(&u8(a.data) + (a.len - 1 - i) * a.element_size, tmp_value, a.element_size)
648648
}
649649
free(tmp_value)

vlib/builtin/int.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module builtin
77
// ----- value to string functions -----
88
//
99

10-
//type u8 = byte
10+
// type u8 = byte
1111
type byte = u8
1212
type i32 = int
1313

0 commit comments

Comments
 (0)