Skip to content

Commit

Permalink
sync,szip,term,time,x.ttf: prepare for making -W impure-v the defau…
Browse files Browse the repository at this point in the history
…lt (#19929)
  • Loading branch information
JalonSolov committed Nov 19, 2023
1 parent 8267874 commit 6cc51f2
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions vlib/term/utf8.c.v

This file was deleted.

6 changes: 3 additions & 3 deletions vlib/term/utf8.v
Expand Up @@ -2,8 +2,8 @@ module term

// utf8_getchar returns an utf8 rune from standard input
pub fn utf8_getchar() ?rune {
c := getchar()
if c == C.EOF {
c := input_character()
if c == -1 {
return none
}
len := utf8_len(u8(~c))
Expand All @@ -16,7 +16,7 @@ pub fn utf8_getchar() ?rune {
} else {
mut uc := c & ((1 << (7 - len)) - 1)
for i := 0; i + 1 < len; i++ {
c2 := getchar()
c2 := input_character()
if c2 != -1 && (c2 >> 6) == 2 {
uc <<= 6
uc |= (c2 & 63)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion vlib/x/ttf/common.v
Expand Up @@ -88,7 +88,7 @@ fn (mut bmp BitMap) format_texture() {
pub fn (mut bmp BitMap) save_as_ppm(file_name string) {
tmp_buf := bmp.buf
mut buf := unsafe { malloc_noscan(bmp.buf_size) }
unsafe { C.memcpy(buf, tmp_buf, bmp.buf_size) }
unsafe { vmemcpy(buf, tmp_buf, bmp.buf_size) }
bmp.buf = buf

bmp.format_texture()
Expand Down
2 changes: 1 addition & 1 deletion vlib/x/ttf/render_bmp.v
Expand Up @@ -54,7 +54,7 @@ pub mut:
pub fn (mut bmp BitMap) clear() {
mut sz := bmp.width * bmp.height * bmp.bp
unsafe {
C.memset(bmp.buf, 0x00, sz)
vmemset(bmp.buf, 0x00, sz)
}
}

Expand Down

0 comments on commit 6cc51f2

Please sign in to comment.