Skip to content

Commit

Permalink
all: fix typos (#19634)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 23, 2023
1 parent 407adaa commit 9051ac8
Show file tree
Hide file tree
Showing 108 changed files with 235 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bootstrapping_works_ci.yml
@@ -1,4 +1,4 @@
name: Bootstraping works
name: Bootstrapping works

on:
schedule:
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Expand Up @@ -154,7 +154,7 @@ endif
fresh_tcc:
rm -rf $(TMPTCC)
ifndef local
# Check wether a TCC branch exists for the user's system configuration.
# Check whether a TCC branch exists for the user's system configuration.
ifneq (,$(findstring thirdparty-$(TCCOS)-$(TCCARCH), $(shell git ls-remote --heads $(TCCREPO) | sed 's/^[a-z0-9]*\trefs.heads.//')))
$(GITFASTCLONE) --branch thirdparty-$(TCCOS)-$(TCCARCH) $(TCCREPO) $(TMPTCC)
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/test_os_process.v
Expand Up @@ -59,7 +59,7 @@ fn main() {
Prints lines periodically (-period_ms), to stdout/stderr (-target).
After a while (-timeout_ms), exit with (-exitcode).
This program is useful for platform independent testing
of child process/standart input/output control.
of child process/standard input/output control.
It is used in V's `os` module tests.
")
return
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vdoc/tests/testdata/newlines/main.comments.out
Expand Up @@ -15,7 +15,7 @@ fn funky()
- bar
# test
########### deep test
#a shouldnt have a newline test
#a shouldn't have a newline test

| foo bar | yes |
|-----------|--------|
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vdoc/tests/testdata/newlines/main.v
Expand Up @@ -12,7 +12,7 @@
// - bar
// # test
// ########### deep test
// #a shouldnt have a newline
// #a shouldn't have a newline
// test
//
// | foo bar | yes |
Expand Down
2 changes: 1 addition & 1 deletion examples/graphs/bellman-ford.v
Expand Up @@ -11,7 +11,7 @@ http://rascunhointeligente.blogspot.com/2010/10/o-algoritmo-de-bellman-ford-um.h
code by CCS
*/

const large = 999999 // almost inifinity
const large = 999999 // almost infinity

// a structure to represent a weighted edge in graph
struct EDGE {
Expand Down
4 changes: 2 additions & 2 deletions examples/graphs/dijkstra.v
Expand Up @@ -125,15 +125,15 @@ fn dijkstra(g [][]int, s int) {
push_pq(mut pq_queue, s, 0) // goes s with priority 0
mut n := g.len

mut dist := []int{len: n, init: -1} // dist with -1 instead of INIFINITY
mut dist := []int{len: n, init: -1} // dist with -1 instead of INFINITE
mut path := []int{len: n, init: -1} // previous node of each shortest path

// Distance of source vertex from itself is always 0
dist[s] = 0

for pq_queue.len != 0 {
mut v := departure_priority(mut pq_queue)
// for all W adjcents vertices of v
// for all W adjacents vertices of v
mut adjs_of_v := all_adjacents(g, v) // all_ADJ of v ....
// print('\n ADJ ${v} is ${adjs_of_v}')
mut new_dist := 0
Expand Down
8 changes: 4 additions & 4 deletions examples/graphs/minimal_spann_tree_prim.v
@@ -1,5 +1,5 @@
/*
Exploring PRIMS,
Exploring PRIMS,
The data example is from
https://www.geeksforgeeks.org/prims-minimum-spanning-tree-mst-greedy-algo-5/
Expand Down Expand Up @@ -117,15 +117,15 @@ fn prim_mst(g [][]int, s int) {
push_pq(mut pq_queue, s, 0) // goes s with priority 0
mut n := g.len

mut dist := []int{len: n, init: -1} // dist with -1 instead of INIFINITY
mut dist := []int{len: n, init: -1} // dist with -1 instead of INFINITE
mut path := []int{len: n, init: -1} // previous node of each shortest path

// Distance of source vertex from itself is always 0
dist[s] = 0

for pq_queue.len != 0 {
mut v := departure_priority(mut pq_queue)
// for all W adjcents vertices of v
// for all W adjacents vertices of v
mut adjs_of_v := all_adjacents(g, v) // all_ADJ of v ....
// print('\n :${dist} :: ${pq_queue}')
// print('\n ADJ ${v} is ${adjs_of_v}')
Expand Down Expand Up @@ -209,7 +209,7 @@ fn main() {
[5, 15, 4, 0],
]

// To find number of coluns
// To find number of columns
// mut cols := an_array[0].len
mut graph := [][]int{} // the graph: adjacency matrix
// for index, g_value in [graph_01, graph_02, graph_03] {
Expand Down
16 changes: 7 additions & 9 deletions examples/sokol/03_march_tracing_glsl/rt_glsl.v
Expand Up @@ -278,12 +278,12 @@ fn draw_cube_glsl(app App) {
tr_matrix := calc_tr_matrices(dw, dh, 0, 0, 2.3)
gfx.apply_viewport(0, 0, ws.width, ws.height, true)

// apply the pipline and bindings
// apply the pipeline and bindings
gfx.apply_pipeline(app.cube_pip_glsl)
gfx.apply_bindings(app.cube_bind)

// Uniforms
// *** vertex shadeer uniforms ***
// *** vertex shader uniforms ***
// passing the view matrix as uniform
// res is a 4x4 matrix of f32 thus: 4*16 byte of size
vs_uniforms_range := gfx.Range{
Expand All @@ -292,20 +292,18 @@ fn draw_cube_glsl(app App) {
}
gfx.apply_uniforms(.vs, C.SLOT_vs_params, &vs_uniforms_range)

// vfmt off
// *** fragment shader uniforms ***
time_ticks := f32(time.ticks() - app.ticks) / 1000
mut tmp_fs_params := [
f32(ws.width),
ws.height * ratio, // x,y resolution to pass to FS
app.mouse_x, // mouse x
ws.height * ratio, // x,y resolution to pass to FS
app.mouse_x, // mouse x
ws.height - app.mouse_y * 2, // mouse y scaled
time_ticks, // time as f32
app.frame_count, // frame count
time_ticks, // time as f32
app.frame_count, // frame count
0,
0 // padding bytes , see "fs_params" struct paddings in rt_glsl.h
0, // padding bytes , see "fs_params" struct paddings in rt_glsl.h
]!
// vfmt on
fs_uniforms_range := gfx.Range{
ptr: unsafe { &tmp_fs_params }
size: usize(sizeof(tmp_fs_params))
Expand Down
2 changes: 1 addition & 1 deletion vlib/arrays/map_of.v
Expand Up @@ -17,7 +17,7 @@ pub fn map_of_indexes[T](array []T) map[T][]int {
}

// map_of_counts returns a map, where each key is an unique value in `array`,
// and each value for that key is how many times that value occures in `array`.
// and each value for that key is how many times that value occurs in `array`.
// It can be useful for building histograms of discrete measurements.
// Example: arrays.map_of_counts([1,2,3,4,4,2,1,4,4]) == {1: 2, 2: 2, 3: 1, 4: 4}
pub fn map_of_counts[T](array []T) map[T]int {
Expand Down
6 changes: 3 additions & 3 deletions vlib/builtin/array.v
Expand Up @@ -203,7 +203,7 @@ fn (mut a array) ensure_cap(required int) {
}

// repeat returns a new array with the given array elements repeated given times.
// `cgen` will replace this with an apropriate call to `repeat_to_depth()`
// `cgen` will replace this with an appropriate call to `repeat_to_depth()`
//
// This is a dummy placeholder that will be overridden by `cgen` with an appropriate
// call to `repeat_to_depth()`. However the `checker` needs it here.
Expand Down Expand Up @@ -627,7 +627,7 @@ fn (a array) clone_static_to_depth(depth int) array {
}

// clone returns an independent copy of a given array.
// this will be overwritten by `cgen` with an apropriate call to `.clone_to_depth()`
// this will be overwritten by `cgen` with an appropriate call to `.clone_to_depth()`
// However the `checker` needs it here.
pub fn (a &array) clone() array {
return unsafe { a.clone_to_depth(0) }
Expand Down Expand Up @@ -827,7 +827,7 @@ pub fn (a array) map(callback fn (voidptr) voidptr) array
// being compared.
//
// Example: array.sort() // will sort the array in ascending order
// Example: array.sort(b < a) // will sort the array in decending order
// Example: array.sort(b < a) // will sort the array in descending order
// Example: array.sort(b.name < a.name) // will sort descending by the .name field
pub fn (mut a array) sort(callback fn (voidptr, voidptr) int)

Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/array_d_gcboehm_opt.v
Expand Up @@ -111,7 +111,7 @@ fn (mut a array) ensure_cap_noscan(required int) {
}

// repeat returns a new array with the given array elements repeated given times.
// `cgen` will replace this with an apropriate call to `repeat_to_depth()`
// `cgen` will replace this with an appropriate call to `repeat_to_depth()`

// version of `repeat()` that handles multi dimensional arrays
// `unsafe` to call directly because `depth` is not checked
Expand Down
10 changes: 5 additions & 5 deletions vlib/builtin/int_test.v
Expand Up @@ -39,7 +39,7 @@ fn test_str_methods() {
assert charptr(1).str() == '0x1'
}

fn test_and_precendence() {
fn test_and_precedence() {
assert (2 & 0 == 0) == ((2 & 0) == 0)
assert (2 & 0 != 0) == ((2 & 0) != 0)
assert (0 & 0 >= 0) == ((0 & 0) >= 0)
Expand All @@ -48,7 +48,7 @@ fn test_and_precendence() {
assert (1 & 2 > 0) == ((1 & 2) > 0)
}

fn test_or_precendence() {
fn test_or_precedence() {
assert (1 | 0 == 0) == ((1 | 0) == 0)
assert (1 | 0 != 1) == ((1 | 0) != 1)
assert (1 | 0 >= 2) == ((1 | 0) >= 2)
Expand All @@ -57,7 +57,7 @@ fn test_or_precendence() {
assert (1 | 0 > 1) == ((1 | 0) > 1)
}

fn test_xor_precendence() {
fn test_xor_precedence() {
assert (1 ^ 0 == 2) == ((1 ^ 0) == 2)
assert (1 ^ 0 != 2) == ((1 ^ 0) != 2)
assert (1 ^ 0 >= 0) == ((1 ^ 0) >= 0)
Expand All @@ -66,12 +66,12 @@ fn test_xor_precendence() {
assert (1 ^ 0 > 1) == ((1 ^ 0) > 1)
}

fn test_left_shift_precendence() {
fn test_left_shift_precedence() {
assert (2 << 4 | 3) == ((2 << 4) | 3)
assert (2 << 4 | 3) != (2 << (4 | 3))
}

fn test_right_shift_precendence() {
fn test_right_shift_precedence() {
assert (256 >> 4 | 3) == ((256 >> 4) | 3)
assert (256 >> 4 | 3) != (256 >> (4 | 3))
}
Expand Down
4 changes: 2 additions & 2 deletions vlib/builtin/js/string.js.v
Expand Up @@ -432,7 +432,7 @@ pub fn (mut s []string) sort() {
s.sort_with_compare(compare_strings)
}

// sort_ignore_case sorts the string array using case insesitive comparing.
// sort_ignore_case sorts the string array using case insensitive comparing.
pub fn (mut s []string) sort_ignore_case() {
s.sort_with_compare(compare_lower_strings)
}
Expand Down Expand Up @@ -484,7 +484,7 @@ pub fn (s string) repeat(count int) string {

// TODO: Make these functions actually work.
// strip_margin allows multi-line strings to be formatted in a way that removes white-space
// before a delimeter. by default `|` is used.
// before a delimiter. By default `|` is used.
// Note: the delimiter has to be a byte at this time. That means surrounding
// the value in ``.
//
Expand Down
14 changes: 7 additions & 7 deletions vlib/builtin/string.v
Expand Up @@ -77,7 +77,7 @@ pub fn (s string) runes() []rune {
// cstring_to_vstring creates a new V string copy of the C style string,
// pointed by `s`. This function is most likely what you want to use when
// working with C style pointers to 0 terminated strings (i.e. `char*`).
// It is recomended to use it, unless you *do* understand the implications of
// It is recommended to use it, unless you *do* understand the implications of
// tos/tos2/tos3/tos4/tos5 in terms of memory management and interactions with
// -autofree and `[manualfree]`.
// It will panic, if the pointer `s` is 0.
Expand Down Expand Up @@ -745,7 +745,7 @@ pub fn (s string) split_any(delim string) []string {
mut i := 0
// check empty source string
if s.len > 0 {
// if empty delimiter string using defautl split
// if empty delimiter string using default split
if delim.len <= 0 {
return s.split('')
}
Expand Down Expand Up @@ -813,7 +813,7 @@ pub fn (s string) rsplit(delim string) []string {
return s.rsplit_nth(delim, 0)
}

// split_once devides string into pair of string by `delim`.
// split_once divides string into pair of string by `delim`.
// Example:
// ```v
// path, ext := 'file.ts.dts'.splice_once('.')?
Expand All @@ -832,7 +832,7 @@ pub fn (s string) split_once(delim string) ?(string, string) {
return result[0], result[1]
}

// rsplit_once devides string into pair of string by `delim`.
// rsplit_once divides string into pair of string by `delim`.
// Example:
// ```v
// path, ext := 'file.ts.dts'.splice_once('.')?
Expand Down Expand Up @@ -1592,7 +1592,7 @@ pub fn (s string) trim(cutset string) string {
return s.substr(left, right)
}

// trim_indexes gets the new start and end indicies of a string when any of the characters given in `cutset` were stripped from the start and end of the string. Should be used as an input to `substr()`. If the string contains only the characters in `cutset`, both values returned are zero.
// trim_indexes gets the new start and end indices of a string when any of the characters given in `cutset` were stripped from the start and end of the string. Should be used as an input to `substr()`. If the string contains only the characters in `cutset`, both values returned are zero.
// Example: left, right := '-hi-'.trim_indexes('-')
[direct_array_access]
pub fn (s string) trim_indexes(cutset string) (int, int) {
Expand Down Expand Up @@ -1719,7 +1719,7 @@ fn compare_lower_strings(a &string, b &string) int {
return compare_strings(&aa, &bb)
}

// sort_ignore_case sorts the string array using case insesitive comparing.
// sort_ignore_case sorts the string array using case insensitive comparing.
[inline]
pub fn (mut s []string) sort_ignore_case() {
s.sort_with_compare(compare_lower_strings)
Expand Down Expand Up @@ -2096,7 +2096,7 @@ pub fn (s string) fields() []string {
}

// strip_margin allows multi-line strings to be formatted in a way that removes white-space
// before a delimeter. by default `|` is used.
// before a delimiter. By default `|` is used.
// Note: the delimiter has to be a byte at this time. That means surrounding
// the value in ``.
//
Expand Down
2 changes: 1 addition & 1 deletion vlib/builtin/string_interpolation.v
Expand Up @@ -147,7 +147,7 @@ pub fn get_str_intp_u32_format(fmt_type StrIntpType, in_width int, in_precision
return res
}

// convert from struct to formated string
// convert from struct to formatted string
[manualfree]
fn (data &StrIntpData) process_str_intp_data(mut sb strings.Builder) {
x := data.fmt
Expand Down
2 changes: 1 addition & 1 deletion vlib/crypto/ed25519/internal/edwards25519/extra.v
Expand Up @@ -326,7 +326,7 @@ pub fn (mut v Point) vartime_multiscalar_mult(scalars []Scalar, points []Point)
// at each iteration and checking whether there is a nonzero
// coefficient to look up a multiple of.
//
// Skip trying to find the first nonzero coefficent, because
// Skip trying to find the first nonzero coefficient, because
// searching might be more work than a few extra doublings.
// k == i, l == j
for k := 255; k >= 0; k-- {
Expand Down
2 changes: 1 addition & 1 deletion vlib/crypto/ed25519/internal/edwards25519/table.v
Expand Up @@ -38,7 +38,7 @@ fn (mut v ProjLookupTable) from_p3(q Point) {
for i := 0; i < 7; i++ {
// Compute (i+1)*Q as Q + i*Q and convert to a ProjCached
// This is needlessly complicated because the API has explicit
// recievers instead of creating stack objects and relying on RVO
// receivers instead of creating stack objects and relying on RVO
v.points[i + 1].from_p3(tmp_p3.from_p1(tmp_p1.add(q, v.points[i])))
}
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/crypto/md5/md5block_generic.v
Expand Up @@ -4,7 +4,7 @@

// This is the generic version with no architecture optimizations.
// In its own file so that an architecture
// optimized verision can be substituted
// optimized version can be substituted

module md5

Expand Down
16 changes: 8 additions & 8 deletions vlib/crypto/pem/decode.v
Expand Up @@ -54,31 +54,31 @@ fn parse_headers(block string) ?(map[string][]string, string) {
return map[string][]string{}, block
}

// seperate lines instead of iterating over them,
// separate lines instead of iterating over them,
// so that we can manually index them
headers_seperated := headers_str.split_into_lines()
headers_separated := headers_str.split_into_lines()

// index the key/value separator ':', otherwise
// return none because it should exist
// the initialisation of this function already tells us headers are present
mut colon_index := headers_seperated[0].index(colon) or { return none }
mut colon_index := headers_separated[0].index(colon) or { return none }

mut headers := map[string][]string{}
mut index := 0

for index < headers_seperated.len - 1 {
line := headers_seperated[index]
for index < headers_separated.len - 1 {
line := headers_separated[index]
if line.len == 0 {
break
}

key := line[..colon_index].trim_space()
mut val := line[colon_index + 1..].trim_space()

for colon_index = 0; index < headers_seperated.len - 1 && colon_index == 0; {
for colon_index = 0; index < headers_separated.len - 1 && colon_index == 0; {
index++
colon_index = headers_seperated[index].index(colon) or {
val += headers_seperated[index].trim_space()
colon_index = headers_separated[index].index(colon) or {
val += headers_separated[index].trim_space()
0
}
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/crypto/sha1/sha1block_generic.v
Expand Up @@ -3,7 +3,7 @@
// that can be found in the LICENSE file.
// This is the generic version with no architecture optimizations.
// In its own file so that an architecture
// optimized verision can be substituted
// optimized version can be substituted
module sha1

import math.bits
Expand Down

0 comments on commit 9051ac8

Please sign in to comment.