Skip to content

Commit

Permalink
[*] applied suggestions from the codespell tool.
Browse files Browse the repository at this point in the history
Tool and documentation can be found at the
https://github.com/codespell-project/codespell

[tests_xml.cpp|text_encoding.c]
  • Loading branch information
TheVice committed Jan 28, 2024
1 parent ca22451 commit 2f88cda
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 115 deletions.
3 changes: 3 additions & 0 deletions .codespell-whitelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
readded
unknwn
uptodate
2 changes: 1 addition & 1 deletion build.build
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<echo message="${property::get-value('cmake')} ${property::get-value('cmake_arguments')}"
level="Verbose" />

<echo message="Working directorty - '${property::get-value('cmake_working_dir')}'"
<echo message="Working directory - '${property::get-value('cmake_working_dir')}'"
level="Verbose" />

<exec program="${property::get-value('cmake')}"
Expand Down
30 changes: 15 additions & 15 deletions file_system.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 - 2022 TheVice
* Copyright (c) 2019 - 2022, 2024 TheVice
*
*/

Expand Down Expand Up @@ -1959,15 +1959,15 @@ uint8_t file_read_with_several_steps(void* stream, void* content)
return 0;
}

size_t readed = 0;
size_t readded = 0;
void* content_ = buffer_data(content, size);

while (0 < (readed = file_read(content_, sizeof(uint8_t), 4096, stream)))
while (0 < (readded = file_read(content_, sizeof(uint8_t), 4096, stream)))
{
size += (ptrdiff_t)readed;
size += (ptrdiff_t)readded;

if (!buffer_resize(content, size) ||
(4096 == readed && !buffer_append(content, NULL, 4096)))
(4096 == readded && !buffer_append(content, NULL, 4096)))
{
return 0;
}
Expand Down Expand Up @@ -2019,16 +2019,16 @@ uint8_t file_read_lines(const uint8_t* path, void* output)
}

ptrdiff_t size = 0;
ptrdiff_t readed;
ptrdiff_t readded;
const uint8_t* start;
uint16_t count_of_lines = 1;
static const uint8_t n = '\n';
uint8_t* content = buffer_uint8_t_data(output, 0);

while (0 < (readed = (ptrdiff_t)file_read((void*)content, sizeof(uint8_t), 4096, stream)))
while (0 < (readded = (ptrdiff_t)file_read((void*)content, sizeof(uint8_t), 4096, stream)))
{
size += readed;
path = content + readed;
size += readded;
path = content + readded;
start = content;

do
Expand Down Expand Up @@ -2505,12 +2505,12 @@ uint8_t file_replace_with_same_length(
uint8_t* content, ptrdiff_t size, void* stream,
const uint8_t* to_be_replaced, const uint8_t* by_replacement, ptrdiff_t length)
{
ptrdiff_t readed = 0;
ptrdiff_t readded = 0;

while (0 < (readed = file_read(content, sizeof(uint8_t), size, stream)))
while (0 < (readded = file_read(content, sizeof(uint8_t), size, stream)))
{
const uint8_t* start = content;
const uint8_t* finish = content + readed;
const uint8_t* finish = content + readded;

while (NULL != start && length <= finish - start)
{
Expand All @@ -2520,7 +2520,7 @@ uint8_t file_replace_with_same_length(
continue;
}

long index = (long)((start - content) - readed);
long index = (long)((start - content) - readded);

if (!file_seek(stream, index, SEEK_CUR))
{
Expand All @@ -2532,7 +2532,7 @@ uint8_t file_replace_with_same_length(
return 0;
}

index = (long)(readed - (start - content) - length);
index = (long)(readded - (start - content) - length);

if (!file_seek(stream, index, SEEK_CUR))
{
Expand All @@ -2542,7 +2542,7 @@ uint8_t file_replace_with_same_length(
start += length;
}

if (readed < size)
if (readded < size)
{
break;
}
Expand Down
8 changes: 4 additions & 4 deletions help.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2042,17 +2042,17 @@ Return *true* if environment variable exists.
----
<?xml version="1.0"?>
<project>
<property name="varibles"
<property name="variables"
value="USERNAME, LOGNAME"
readonly="true" />
<property name="True" value="exists" readonly="true" />
<property name="False" value="not exists" readonly="true" />
<property name="exists"
value="${environment::variable-exists(varible)}"
value="${environment::variable-exists(variable)}"
dynamic="true"
readonly="true" />
<foreach item="String" in="${varibles}" delim="," trim="Start" property="varible">
<echo>Environment varible '${varible}' is ${property::get-value(exists)}.</echo>
<foreach item="String" in="${variables}" delim="," trim="Start" property="variable">
<echo>Environment variable '${variable}' is ${property::get-value(exists)}.</echo>
</foreach>
</project>
----
Expand Down
56 changes: 28 additions & 28 deletions interpreter.hash.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2022 TheVice
* Copyright (c) 2022, 2024 TheVice
*
*/

Expand Down Expand Up @@ -239,12 +239,12 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
break;
}

size_t readed = 0;
size_t readded = 0;
uint8_t* last = NULL;
ptrdiff_t bytes_compressed = 0;
uint8_t* file_content = buffer_uint8_t_data(output, size + 64 + 128);

while (0 < (readed = file_read(file_content, sizeof(uint8_t), 4096, file)))
while (0 < (readded = file_read(file_content, sizeof(uint8_t), 4096, file)))
{
if (last && !BLAKE2b_core(last, last + 128, &bytes_compressed, out))
{
Expand All @@ -254,13 +254,13 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,

last = NULL;

if (4096 != readed)
if (4096 != readded)
{
if (128 < readed)
if (128 < readded)
{
uint16_t bytes_to_compress = (uint16_t)(128 * (readed / 128));
uint16_t bytes_to_compress = (uint16_t)(128 * (readded / 128));

if (0 == readed % 128)
if (0 == readded % 128)
{
bytes_to_compress -= 128;
}
Expand All @@ -271,7 +271,7 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
return 0;
}

readed -= bytes_compressed;
readded -= bytes_compressed;
file_content += bytes_to_compress;
}

Expand Down Expand Up @@ -300,10 +300,10 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,

if (last)
{
if (!readed)
if (!readded)
{
file_content = last;
readed = 128;
readded = 128;
}
else
{
Expand All @@ -314,7 +314,7 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
}
}

if (!BLAKE2b_final(file_content, &bytes_compressed, (uint8_t)readed, out))
if (!BLAKE2b_final(file_content, &bytes_compressed, (uint8_t)readded, out))
{
break;
}
Expand Down Expand Up @@ -351,13 +351,13 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
/**/
uint8_t compressed = 0;
uint8_t stack_length = 0;
size_t readed = 0;
size_t readded = 0;
/**/
uint8_t* file_content = buffer_uint8_t_data(output, size);

while (0 < (readed = file_read(file_content, sizeof(uint8_t), 4096, file)))
while (0 < (readded = file_read(file_content, sizeof(uint8_t), 4096, file)))
{
if (!BLAKE3_core(file_content, readed, m, &l, h, &compressed, t, stack, &stack_length, d))
if (!BLAKE3_core(file_content, readded, m, &l, h, &compressed, t, stack, &stack_length, d))
{
file_close(file);
return 0;
Expand All @@ -384,7 +384,7 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
break;
}

size_t readed = 0;
size_t readded = 0;
uint8_t* file_content = buffer_uint8_t_data(output, size);
uint8_t* out = file_content + 4096;

Expand All @@ -393,9 +393,9 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
break;
}

while (0 < (readed = file_read(file_content, sizeof(uint8_t), 4096, file)))
while (0 < (readded = file_read(file_content, sizeof(uint8_t), 4096, file)))
{
if (!hash_algorithm_crc32_core(file_content, file_content + readed, out))
if (!hash_algorithm_crc32_core(file_content, file_content + readded, out))
{
file_close(file);
return 0;
Expand Down Expand Up @@ -440,15 +440,15 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
0, 0, 0, 0, 0
};
/**/
size_t readed = 0;
size_t readded = 0;
uint8_t* file_content = buffer_uint8_t_data(output, size);

while (0 < (readed = file_read(file_content, sizeof(uint8_t), 4096, file)))
while (0 < (readded = file_read(file_content, sizeof(uint8_t), 4096, file)))
{
const uint8_t* finish = file_content + readed;
readed = hash_algorithm_sha3_core(file_content, finish, queue, &queue_size, maximum_delta, S, rate_on_w);
const uint8_t* finish = file_content + readded;
readded = hash_algorithm_sha3_core(file_content, finish, queue, &queue_size, maximum_delta, S, rate_on_w);

if (!readed)
if (!readded)
{
file_close(file);
return 0;
Expand Down Expand Up @@ -492,12 +492,12 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
seed = (uint32_t)uint64_parse(algorithm_parameter->start, algorithm_parameter->finish);
}

size_t readed = 0;
size_t readded = 0;
uint8_t* file_content = buffer_uint8_t_data(output, size);

while (0 < (readed = file_read(file_content, sizeof(uint8_t), 4096, file)))
while (0 < (readded = file_read(file_content, sizeof(uint8_t), 4096, file)))
{
const uint8_t* finish = file_content + readed;
const uint8_t* finish = file_content + readded;

if (!hash_algorithm_XXH32_core(file_content, finish,
queue, &queue_size, max_queue_size,
Expand Down Expand Up @@ -543,12 +543,12 @@ uint8_t file_get_checksum_(const uint8_t* path, uint8_t algorithm,
seed = uint64_parse(algorithm_parameter->start, algorithm_parameter->finish);
}

size_t readed = 0;
size_t readded = 0;
uint8_t* file_content = buffer_uint8_t_data(output, size);

while (0 < (readed = file_read(file_content, sizeof(uint8_t), 4096, file)))
while (0 < (readded = file_read(file_content, sizeof(uint8_t), 4096, file)))
{
const uint8_t* finish = file_content + readed;
const uint8_t* finish = file_content + readded;

if (!hash_algorithm_XXH64_core(file_content, finish,
queue, &queue_size, max_queue_size,
Expand Down
Loading

0 comments on commit 2f88cda

Please sign in to comment.