Skip to content

Commit 1c17b79

Browse files
pre-commit automatic fixes
1 parent 569ed41 commit 1c17b79

Some content is hidden

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

66 files changed

+454
-536
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
curl -O https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/macosx/nasm-${NASM_VERSION}-macosx.zip
3838
unzip nasm-${NASM_VERSION}-macosx.zip
3939
echo $(pwd)/nasm-${NASM_VERSION} >> $GITHUB_PATH
40-
40+
4141
- name: Run exercism/x86-64-assembly ci (runs tests) for all exercises
4242
env:
4343
CC: ${{ matrix.compiler }}

docs/SNIPPET.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ section .text
77
global hello
88
hello:
99
lea rax, [msg]
10-
ret
10+
ret

exercises/practice/acronym/.meta/example.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ abbreviate:
6868

6969
%ifidn __OUTPUT_FORMAT__,elf64
7070
section .note.GNU-stack noalloc noexec nowrite progbits
71-
%endif
71+
%endif

exercises/practice/acronym/acronym.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ abbreviate:
88

99
%ifidn __OUTPUT_FORMAT__,elf64
1010
section .note.GNU-stack noalloc noexec nowrite progbits
11-
%endif
11+
%endif

exercises/practice/acronym/acronym_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Version: 0
22

3-
#include <string.h>
3+
#include <string.h>
44

55
#include "vendor/unity.h"
66

77
#define BUFFER_SIZE 0x100
88
char out[BUFFER_SIZE];
99

10-
extern void abbreviate(const char* in, char* out);
10+
extern void abbreviate(const char *in, char *out);
1111

1212
void tearDown(void) {
13-
memset(out, 0, BUFFER_SIZE*sizeof(char));
13+
memset(out, 0, BUFFER_SIZE * sizeof(char));
1414
}
1515

1616
void setUp(void) {

exercises/practice/all-your-base/.meta/example.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ rebase:
8282
mov r11d, dword [r9]
8383

8484
mov dword [r9], r10d
85-
mov dword [rcx], r11d
85+
mov dword [rcx], r11d
8686

8787
add rcx, 4
8888
sub r9, 4

exercises/practice/atbash-cipher/.meta/example.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ done:
4444
; cl - count to next space
4545
encode:
4646
cld ; rsi/rdi will be incremented with each lodsb/stosb
47-
mov cl, 6 ; immediately before the 6th byte, we will insert a space
47+
mov cl, 6 ; immediately before the 6th byte, we will insert a space
4848
jmp .encode_in
4949

5050

exercises/practice/book-store/book_store_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void test_two_of_the_same_book(void) {
2626

2727
void test_empty_basket(void) {
2828
TEST_IGNORE();
29-
const int16_t* basket = NULL;
29+
const int16_t *basket = NULL;
3030
TEST_ASSERT_EQUAL_INT(0, total(0, basket));
3131
}
3232

exercises/practice/house/house_test.c

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ void tearDown(void) {
1111
}
1212

1313
void test_verse_one__the_house_that_jack_built(void) {
14-
const char *expected =
15-
"This is the house that Jack built.\n";
14+
const char *expected = "This is the house that Jack built.\n";
1615
char buffer[BUFFER_SIZE];
1716

1817
recite(buffer, 1, 1);
@@ -21,8 +20,7 @@ void test_verse_one__the_house_that_jack_built(void) {
2120

2221
void test_verse_two__the_malt_that_lay(void) {
2322
TEST_IGNORE();
24-
const char *expected =
25-
"This is the malt that lay in the house that Jack built.\n";
23+
const char *expected = "This is the malt that lay in the house that Jack built.\n";
2624
char buffer[BUFFER_SIZE];
2725

2826
recite(buffer, 2, 2);
@@ -31,8 +29,7 @@ void test_verse_two__the_malt_that_lay(void) {
3129

3230
void test_verse_three__the_rat_that_ate(void) {
3331
TEST_IGNORE();
34-
const char *expected =
35-
"This is the rat that ate the malt that lay in the house that Jack built.\n";
32+
const char *expected = "This is the rat that ate the malt that lay in the house that Jack built.\n";
3633
char buffer[BUFFER_SIZE];
3734

3835
recite(buffer, 3, 3);
@@ -41,8 +38,7 @@ void test_verse_three__the_rat_that_ate(void) {
4138

4239
void test_verse_four__the_cat_that_killed(void) {
4340
TEST_IGNORE();
44-
const char *expected =
45-
"This is the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
41+
const char *expected = "This is the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
4642
char buffer[BUFFER_SIZE];
4743

4844
recite(buffer, 4, 4);
@@ -62,7 +58,8 @@ void test_verse_five__the_dog_that_worried(void) {
6258
void test_verse_six__the_cow_with_the_crumpled_horn(void) {
6359
TEST_IGNORE();
6460
const char *expected =
65-
"This is the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
61+
"This is the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in "
62+
"the house that Jack built.\n";
6663
char buffer[BUFFER_SIZE];
6764

6865
recite(buffer, 6, 6);
@@ -72,7 +69,8 @@ void test_verse_six__the_cow_with_the_crumpled_horn(void) {
7269
void test_verse_seven__the_maiden_all_forlorn(void) {
7370
TEST_IGNORE();
7471
const char *expected =
75-
"This is the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
72+
"This is the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed "
73+
"the rat that ate the malt that lay in the house that Jack built.\n";
7674
char buffer[BUFFER_SIZE];
7775

7876
recite(buffer, 7, 7);
@@ -82,7 +80,8 @@ void test_verse_seven__the_maiden_all_forlorn(void) {
8280
void test_verse_eight__the_man_all_tattered_and_torn(void) {
8381
TEST_IGNORE();
8482
const char *expected =
85-
"This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
83+
"This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed "
84+
"the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
8685
char buffer[BUFFER_SIZE];
8786

8887
recite(buffer, 8, 8);
@@ -92,7 +91,9 @@ void test_verse_eight__the_man_all_tattered_and_torn(void) {
9291
void test_verse_nine__the_priest_all_shaven_and_shorn(void) {
9392
TEST_IGNORE();
9493
const char *expected =
95-
"This is the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
94+
"This is the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked "
95+
"the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the "
96+
"house that Jack built.\n";
9697
char buffer[BUFFER_SIZE];
9798

9899
recite(buffer, 9, 9);
@@ -102,7 +103,9 @@ void test_verse_nine__the_priest_all_shaven_and_shorn(void) {
102103
void test_verse_10__the_rooster_that_crowed_in_the_morn(void) {
103104
TEST_IGNORE();
104105
const char *expected =
105-
"This is the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
106+
"This is the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn "
107+
"that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that "
108+
"killed the rat that ate the malt that lay in the house that Jack built.\n";
106109
char buffer[BUFFER_SIZE];
107110

108111
recite(buffer, 10, 10);
@@ -112,7 +115,9 @@ void test_verse_10__the_rooster_that_crowed_in_the_morn(void) {
112115
void test_verse_11__the_farmer_sowing_his_corn(void) {
113116
TEST_IGNORE();
114117
const char *expected =
115-
"This is the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
118+
"This is the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that "
119+
"married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed "
120+
"the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
116121
char buffer[BUFFER_SIZE];
117122

118123
recite(buffer, 11, 11);
@@ -122,7 +127,10 @@ void test_verse_11__the_farmer_sowing_his_corn(void) {
122127
void test_verse_12__the_horse_and_the_hound_and_the_horn(void) {
123128
TEST_IGNORE();
124129
const char *expected =
125-
"This is the horse and the hound and the horn that belonged to the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
130+
"This is the horse and the hound and the horn that belonged to the farmer sowing his corn that kept the rooster that crowed in the "
131+
"morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that "
132+
"milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in "
133+
"the house that Jack built.\n";
126134
char buffer[BUFFER_SIZE];
127135

128136
recite(buffer, 12, 12);
@@ -134,9 +142,12 @@ void test_multiple_verses(void) {
134142
const char *expected =
135143
"This is the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
136144
"This is the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
137-
"This is the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
138-
"This is the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
139-
"This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
145+
"This is the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in "
146+
"the house that Jack built.\n"
147+
"This is the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed "
148+
"the rat that ate the malt that lay in the house that Jack built.\n"
149+
"This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed "
150+
"the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
140151
char buffer[BUFFER_SIZE];
141152

142153
recite(buffer, 4, 8);
@@ -151,13 +162,25 @@ void test_full_rhyme(void) {
151162
"This is the rat that ate the malt that lay in the house that Jack built.\n"
152163
"This is the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
153164
"This is the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
154-
"This is the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
155-
"This is the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
156-
"This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
157-
"This is the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
158-
"This is the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
159-
"This is the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
160-
"This is the horse and the hound and the horn that belonged to the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n";
165+
"This is the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in "
166+
"the house that Jack built.\n"
167+
"This is the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed "
168+
"the rat that ate the malt that lay in the house that Jack built.\n"
169+
"This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed "
170+
"the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
171+
"This is the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked "
172+
"the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the "
173+
"house that Jack built.\n"
174+
"This is the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn "
175+
"that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that "
176+
"killed the rat that ate the malt that lay in the house that Jack built.\n"
177+
"This is the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that "
178+
"married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed "
179+
"the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.\n"
180+
"This is the horse and the hound and the horn that belonged to the farmer sowing his corn that kept the rooster that crowed in the "
181+
"morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that "
182+
"milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in "
183+
"the house that Jack built.\n";
161184
char buffer[BUFFER_SIZE];
162185

163186
recite(buffer, 1, 12);

exercises/practice/knapsack/.meta/example.asm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ maximumValue:
2020
mov r11, rdx
2121
sub r11d, r10d
2222
js .skip_item
23-
23+
2424
; Next step is to find what value in can get with the item
2525
dec esi
2626
add rdi, 8
@@ -34,7 +34,7 @@ maximumValue:
3434

3535
; What value can we get if item was included?
3636
call maximumValue
37-
37+
3838
pop rdi
3939
pop rsi
4040
pop rdx
@@ -51,7 +51,7 @@ maximumValue:
5151

5252
pop r11
5353

54-
; Which value is higher?
54+
; Which value is higher?
5555
cmp rax, r11
5656
jge .return
5757

@@ -71,4 +71,3 @@ maximumValue:
7171
%ifidn __OUTPUT_FORMAT__,elf64
7272
section .note.GNU-stack noalloc noexec nowrite progbits
7373
%endif
74-

0 commit comments

Comments
 (0)