Skip to content

Commit

Permalink
all: fix typos (vlang#21089)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Mar 25, 2024
1 parent 9ad84dd commit f77bb32
Show file tree
Hide file tree
Showing 193 changed files with 403 additions and 402 deletions.
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
- io: add a `string_reader` submodule (#20893)
- toml: return an error from toml.parse_file(), when the passed file path does not exist (#20912)
- x.json2: fix encoder commas (#20916)
- time: microoptimise the Time formating methods (use custom number->string conversion, instead of string interpolation) (#20917)
- time: microoptimise the Time formatting methods (use custom number->string conversion, instead of string interpolation) (#20917)
- x.json2: improve performance of string encoding for unicode special characters and emojis (#20867)
- x.json2: minor performance improvement, update benchmark recommendations (#20954)
- os: workaround a `-prod -cc gcc` bug, affecting os.open_file (fix #20923) (related to #20872) (#20960)
Expand All @@ -168,7 +168,7 @@
- net: remove unused import in tcp_test.v
- x.vweb: add error, when static directory does not exist (#20455)
- net.urllib: fix parsing url error, when querypath is '//' (fix #20476) (#20504)
- vweb: unify listen addres from tcp and print (#20448)
- vweb: unify listen address from tcp and print (#20448)
- net.unix: make the error messages in unix_test.v more specific (#20537)
- vweb: add an optional Context.before_accept_loop/0 method, to make testing easier and more robust (#20538)
- vweb: fix routes without results in vweb_app_test.v (#20548)
Expand All @@ -182,7 +182,7 @@
- x.vweb: add cors middleware (#20713)
- x.vweb: add new sessions module (#20642)
- net: fix non-blocking read/write (#20438)
- net: reduce flakyness of tcp test (#20761)
- net: reduce flakiness of tcp test (#20761)
- picoev: renaming, doc (#20567)
- x.vweb: add full static host support, for urls ending with /folder/ , where the folder backing it, has `index.html` inside (#20784)
- x.sessions: change session Store interface to use results instead of options (#20796)
Expand Down Expand Up @@ -464,7 +464,7 @@
- Fix arrays alias built-in methods call(fix #19896) (#19910)
- Fix generic array initialization (fix #19903) (#19916)
- Fix option sumtype auto deref (#19919)
- Ast, checker, cgen: fix interface embeded methods call(fix #16496) (#19936)
- Ast, checker, cgen: fix interface embedded methods call(fix #16496) (#19936)
- Fix ref and deref when an interface is used as a function parameter (fix #19947) (#19966)
- Fix auto str for interface struct member which implements str method (#19970)
- Fix generics call with interface arg (fix #19976) (#20002)
Expand Down Expand Up @@ -559,7 +559,7 @@
- Fix fn call with option call argument in autofree mode (#19515)
- Bring back pascal case check for aliases
- C.xx = C.yy aliases
- Allow casted integeral types in match ranges (#19572)
- Allow casted integral types in match ranges (#19572)
- Warn about byte deprecation, when used as a fn parameter (#19629)
- Allow size of fixed array to be integral casts (#19663)
- Fix generic array append (#19658)
Expand Down Expand Up @@ -631,7 +631,7 @@
- orm: make is_null/is_not_null unary ops; don't bind null in where (#19635)

#### Database drivers
- pg: hande C calls, move to .c.v files (#19739)
- pg: handle C calls, move to .c.v files (#19739)

#### Native backend
- native: support `-no-builtin` (generate executables < 1KB Linux with `v -no-builtin -b native examples/hello_world.v`)
Expand All @@ -654,7 +654,7 @@

#### vfmt
- Remove additional line breaks after call_expr before params struct args (#19795)
- Fix map value aligment when using keys with uft8 symbols (#19689)
- Fix map value alignment when using keys with uft8 symbols (#19689)
- Align ternary expressions in const blocks (#19721)
- Respect range index expressions in match branches (#19684)
- Respect raw strings in `$embed_file(r'/some/path')` expressions (#19753)
Expand Down Expand Up @@ -1021,7 +1021,7 @@ https://github.com/vlang/v/blob/master/changelogs0.x/0.4.md
- Disallow type matching with primitive vars.
- Warning instead of error for unnecessary brackets in if/match.
- Include import aliases when checking for import duplicates.
- Fix infering generic array type in nested call.
- Fix inferring generic array type in nested call.
- Allow casted `enum val` and `const` as fixed array size.
- Disallow multiple return values in const declarations.
- Fix contains() with array of interfaces.
Expand Down
2 changes: 1 addition & 1 deletion changelogs0.x/0.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
- Disallow type matching with primitive vars.
- Warning instead of error for unnecessary brackets in if/match.
- Include import aliases when checking for import duplicates.
- Fix infering generic array type in nested call.
- Fix inferring generic array type in nested call.
- Allow casted `enum val` and `const` as fixed array size.
- Disallow multiple return values in const declarations.
- Fix contains() with array of interfaces.
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vcomplete.v
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ fn auto_complete_request(args []string) []string {
add_sep := if part == '~' { os.path_separator } else { '' }
part = part.replace_once('~', os.home_dir().trim_right(os.path_separator)) + add_sep
}
is_abs_path := part.starts_with(os.path_separator) // TODO Windows support for drive prefixes
is_abs_path := part.starts_with(os.path_separator) // TODO: Windows support for drive prefixes
if part.ends_with(os.path_separator) || part == '.' || part == '..' {
// 'v <command>(.*/$|.|..)<tab>' -> output full directory list
ls_path = '.' + os.path_separator + part
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vdoc/main.v
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mut:
symbol_name string
platform doc.Platform
run_examples bool // `-run-examples` will run all `// Example: assert mod.abc() == y` comments in the processed modules
// The options below are useful for generating a more stable HMTL, that is easier to regression test:
// The options below are useful for generating a more stable HTML, that is easier to regression test:
html_only_contents bool // `-html-only-contents` will produce only the content of any given page, without styling tags etc.
html_no_vhash bool // `-html-no-vhash` will remove the version hash from the generated html
html_no_assets bool // `-html-no-assets` will not include CSS and JS asset tags in the generated html
Expand Down
2 changes: 1 addition & 1 deletion examples/2048/2048.v
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ fn (mut app App) handle_tap() {
} else if avgy < (m * 9 / 10) + ypad {
app.new_game()
} else {
// TODO remove and implement an actual way to toggle themes on mobile
// TODO: remove and implement an actual way to toggle themes on mobile
}
}
} else if app.state == .over {
Expand Down
2 changes: 1 addition & 1 deletion examples/sokol/06_obj_viewer/modules/obj/rend.v
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn load_texture(file_name string) (gfx.Image, gfx.Sampler) {
buffer := read_bytes_from_file(file_name)
stbi.set_flip_vertically_on_load(true)
img := stbi.load_from_memory(buffer.data, buffer.len) or {
eprintln('Texure file: [${file_name}] ERROR!')
eprintln('Texture file: [${file_name}] ERROR!')
exit(0)
}
sg_img, sg_smp := create_texture(int(img.width), int(img.height), img.data)
Expand Down
4 changes: 2 additions & 2 deletions examples/sokol/06_obj_viewer/modules/obj/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ pub fn read_bytes_from_file(file_path string) []u8 {
$if android {
path = 'models/' + file_path
buffer = os.read_apk_asset(path) or {
eprintln('Texure file: [${path}] NOT FOUND!')
eprintln('Texture file: [${path}] NOT FOUND!')
exit(0)
}
} $else {
path = os.resource_abs_path('assets/models/' + file_path)
buffer = os.read_bytes(path) or {
eprintln('Texure file: [${path}] NOT FOUND!')
eprintln('Texture file: [${path}] NOT FOUND!')
exit(0)
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/term.ui/pong.v
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn (mut a App) event(e &ui.Event) {
if a.mode != .game {
return
}
// TODO mouse movement for real Pong sharks
// TODO: mouse movement for real Pong sharks
// a.game.move_player(player_one, 0, -1)
}
.key_down {
Expand Down Expand Up @@ -344,7 +344,7 @@ fn (mut g Game) quit() {
}

fn (mut g Game) draw_big_digit(px f32, py f32, digit int) {
// TODO use draw_line or draw_point to fix tearing with non-monospaced terminal fonts
// TODO: use draw_line or draw_point to fix tearing with non-monospaced terminal fonts
mut gfx := g.app.tui
x, y := int(px), int(py)
match digit {
Expand Down Expand Up @@ -457,7 +457,7 @@ fn (mut g Game) free() {
g.players.clear()
}

// TODO Remove these wrapper functions when we can assign methods as callbacks
// TODO: Remove these wrapper functions when we can assign methods as callbacks
fn init(mut app App) {
app.init()
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tetris/tetris.js.v
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ fn (mut g Game) get_tetro() {
// g.tetro = g.tetros_cache[idx..idx + tetro_size].clone()
}

// TODO mut
// TODO: mut
fn (mut g Game) drop_tetro() {
for i in 0 .. tetro_size {
tetro := g.tetro[i]
Expand Down
2 changes: 1 addition & 1 deletion examples/viewer/view.v
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn (mut app App) read_bytes(path string) bool {
pub fn read_bytes_from_file(file_path string) []u8 {
mut buffer := []u8{}
buffer = os.read_bytes(file_path) or {
eprintln('ERROR: Texure file: [${file_path}] NOT FOUND.')
eprintln('ERROR: Texture file: [${file_path}] NOT FOUND.')
exit(0)
}
return buffer
Expand Down
4 changes: 2 additions & 2 deletions examples/xvweb/todo/main.v
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn (app &App) create_todo(mut ctx Context, name string) vweb.Result {
// insert the todo into our database
sql app.db {
insert todo into Todo
} or { return ctx.server_error('could not insert a new TODO in the datbase') }
} or { return ctx.server_error('could not insert a new TODO in the database') }

ctx.created_todo = true

Expand Down Expand Up @@ -127,7 +127,7 @@ pub fn (app &App) delete_todo(mut ctx Context, id int) vweb.Result {

fn main() {
os.chdir(os.dir(@FILE))!
// create a new App instance with a connection to the datbase
// create a new App instance with a connection to the database
mut app := &App{
db: sqlite.connect('todo.db')!
}
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/fontstash/fontstash.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ typedef struct FONStextIter FONStextIter;

typedef struct FONScontext FONScontext;

// Contructor and destructor.
// Constructor and destructor.
FONS_DEF FONScontext* fonsCreateInternal(FONSparams* params);
FONS_DEF void fonsDeleteInternal(FONScontext* s);

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/libatomic_ops/atomic_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
# include <machine/sys/inline.h>
# define AO_compiler_barrier() _Asm_sched_fence()
# else
/* FIXME - We do not know how to do this. This is a guess. */
/* FIXME: We do not know how to do this. This is a guess. */
/* And probably a bad one. */
static volatile int AO_barrier_dummy;
# define AO_compiler_barrier() (void)(AO_barrier_dummy = AO_barrier_dummy)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/libgc/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28976,7 +28976,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
in_allocd_block = is_header_found_async(addr);
# endif
if (!in_allocd_block) {
/* FIXME - We should make sure that we invoke the */
/* FIXME: We should make sure that we invoke the */
/* old handler with the appropriate calling */
/* sequence, which often depends on SA_SIGINFO. */

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/sokol/sokol_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -14592,7 +14592,7 @@ _SOKOL_PRIVATE void _sg_wgpu_commit(void) {

_SOKOL_PRIVATE void _sg_wgpu_apply_viewport(int x, int y, int w, int h, bool origin_top_left) {
SOKOL_ASSERT(_sg.wgpu.pass_enc);
// FIXME FIXME FIXME: CLIPPING THE VIEWPORT HERE IS WRONG!!!
// FIXME: CLIPPING THE VIEWPORT HERE IS WRONG!!!
// (but currently required because WebGPU insists that the viewport rectangle must be
// fully contained inside the framebuffer, but this doesn't make any sense, and also
// isn't required by the backend APIs)
Expand Down
2 changes: 1 addition & 1 deletion vlib/arrays/arrays.v
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub fn merge[T](a []T, b []T) []T {
mut ia := 0
mut ib := 0
mut j := 0
// TODO efficient approach to merge_desc where: a[ia] >= b[ib]
// TODO: efficient approach to merge_desc where: a[ia] >= b[ib]
for ia < a.len && ib < b.len {
if a[ia] <= b[ib] {
m[j] = a[ia]
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/array.v
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn new_array_from_c_array(len int, cap int, elm_size int, c_array voidptr) array
len: len
cap: cap_
}
// TODO Write all memory functions (like memcpy) in V
// TODO: Write all memory functions (like memcpy) in V
unsafe { vmemcpy(arr.data, c_array, u64(len) * u64(elm_size)) }
return arr
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/array_d_gcboehm_opt.v
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn new_array_from_c_array_noscan(len int, cap int, elm_size int, c_array voidptr
len: len
cap: cap_
}
// TODO Write all memory functions (like memcpy) in V
// TODO: Write all memory functions (like memcpy) in V
unsafe { vmemcpy(arr.data, c_array, u64(len) * u64(elm_size)) }
return arr
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/array_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ fn test_i64_sort() {
fn test_sort_index_expr() {
mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)],
[i64(0)], [i64(27)]]
// TODO This currently gives "indexing pointer" error without unsafe
// TODO: This currently gives "indexing pointer" error without unsafe
unsafe {
f.sort(a[0] < b[0])
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/builtin_windows.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn builtin_init() {
}
}

// TODO copypaste from os
// TODO: copypaste from os
// we want to be able to use this here without having to `import os`
struct ExceptionRecord {
pub:
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/cfns.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn C.fputs(str &char, stream &C.FILE) int

fn C.fflush(&C.FILE) int

// TODO define args in these functions
// TODO: define args in these functions
fn C.fseek(stream &C.FILE, offset int, whence int) int

fn C.fopen(filename &char, mode &char) &C.FILE
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/float.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
module builtin

// TODO implement compile time conditional include
// TODO: implement compile time conditional include
// [if !nofloat]
import strconv

Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/js/array_test.js.v
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ fn test_i64_sort() {
fn test_sort_index_expr() {
mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)],
[i64(0)], [i64(27)]]
// TODO This currently gives "indexing pointer" error without unsafe
// TODO: This currently gives "indexing pointer" error without unsafe
unsafe {
f.sort(a[0] < b[0])
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/js/string_test.js.v
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ fn test_repeat() {
assert s2.repeat(5) == s2
assert s2.repeat(1) == s2
assert s2.repeat(0) == s2
// TODO Add test for negative values
// TODO: Add test for negative values
}

fn test_starts_with() {
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/map.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn map_hash_int_8(pkey voidptr) u64 {

// Move all zeros to the end of the array and resize array
fn (mut d DenseArray) zeros_to_end() {
// TODO alloca?
// TODO: alloca?
mut tmp_value := unsafe { malloc(d.value_bytes) }
mut tmp_key := unsafe { malloc(d.key_bytes) }
mut count := 0
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/map.v
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ fn new_map(key_bytes int, value_bytes int, hash_fn MapHashFn, key_eq_fn MapEqFn,

fn new_map_init(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn, free_fn)
// TODO pre-allocate n slots
// TODO: pre-allocate n slots
mut pkey := &u8(keys)
mut pval := &u8(values)
for _ in 0 .. n {
Expand Down
6 changes: 3 additions & 3 deletions vlib/builtin/map_d_gcboehm_opt.v
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn new_map_noscan_key_value(key_bytes int, value_bytes int, hash_fn MapHashFn, k
fn new_map_init_noscan_key(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map_noscan_key(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn,
free_fn)
// TODO pre-allocate n slots
// TODO: pre-allocate n slots
mut pkey := &u8(keys)
mut pval := &u8(values)
for _ in 0 .. n {
Expand All @@ -114,7 +114,7 @@ fn new_map_init_noscan_key(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapClo
fn new_map_init_noscan_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map_noscan_value(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn,
free_fn)
// TODO pre-allocate n slots
// TODO: pre-allocate n slots
mut pkey := &u8(keys)
mut pval := &u8(values)
for _ in 0 .. n {
Expand All @@ -130,7 +130,7 @@ fn new_map_init_noscan_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapC
fn new_map_init_noscan_key_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map_noscan_key_value(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn,
free_fn)
// TODO pre-allocate n slots
// TODO: pre-allocate n slots
mut pkey := &u8(keys)
mut pval := &u8(values)
for _ in 0 .. n {
Expand Down
Loading

0 comments on commit f77bb32

Please sign in to comment.