Skip to content

Commit 1999b47

Browse files
resolve unused param for format char
1 parent 93cf7f7 commit 1999b47

File tree

4 files changed

+34
-39
lines changed

4 files changed

+34
-39
lines changed

code/logic/fossil/io/soap.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ char *fossil_io_soap_sanitize(const char *text);
3333
* @brief Suggest proper alternatives for rot-brain words or grammar fixes.
3434
*
3535
* @param text The input text.
36-
* @param format_type Custom format for output (e.g., "*" or "#").
3736
* @return A dynamically allocated string with suggestions (must be freed by the caller).
3837
*/
39-
char *fossil_io_soap_suggest(const char *text, char format_type);
38+
char *fossil_io_soap_suggest(const char *text);
4039

4140
/**
4241
* @brief Add a custom word or phrase to the filter.
@@ -96,8 +95,8 @@ namespace fossil {
9695
* @param format_type Custom format for output (e.g., "*" or "#").
9796
* @return A dynamically allocated string with suggestions (must be freed by the caller).
9897
*/
99-
static std::string suggest(const std::string &text, char format_type = '*') {
100-
return fossil_io_soap_suggest(text.c_str(), format_type);
98+
static std::string suggest(const std::string &text) {
99+
return fossil_io_soap_suggest(text.c_str());
101100
}
102101

103102
/**
@@ -145,8 +144,8 @@ namespace fossil {
145144
* @param format_type Custom format for output (e.g., "*" or "#").
146145
* @return A dynamically allocated string with suggestions (must be freed by the caller).
147146
*/
148-
static char* suggest(const char* text, char format_type = '*') {
149-
return fossil_io_soap_suggest(text, format_type);
147+
static char* suggest(const char* text) {
148+
return fossil_io_soap_suggest(text);
150149
}
151150

152151
/**

code/logic/soap.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,7 @@ char *fossil_io_soap_sanitize(const char *text) {
298298
return output;
299299
}
300300

301-
/**
302-
* @brief Suggest proper alternatives for rot-brain words or grammar fixes.
303-
* @param format_type Custom format for output (e.g., "*" or "#").
304-
*/
305-
char *fossil_io_soap_suggest(const char *text, char format_type) {
301+
char *fossil_io_soap_suggest(const char *text) {
306302
if (!text) return NULL;
307303

308304
size_t len = strlen(text);

code/tests/cases/test_soap.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ FOSSIL_TEST_CASE(c_test_io_soap_sanitize_long_input) {
9494
FOSSIL_TEST_CASE(c_test_io_soap_suggest) {
9595
const char *input = "This is a rot-brain sentence.";
9696
const char *expected = "This is a stupid sentence.";
97-
char *result = fossil_io_soap_suggest(input, '*');
97+
char *result = fossil_io_soap_suggest(input);
9898
ASSUME_ITS_EQUAL_CSTR(expected, result);
9999
free(result);
100100
}
101101

102102
FOSSIL_TEST_CASE(c_test_io_soap_suggest_no_offensive) {
103103
const char *input = "This is a clean sentence.";
104104
const char *expected = "This is a clean sentence.";
105-
char *result = fossil_io_soap_suggest(input, '*');
105+
char *result = fossil_io_soap_suggest(input);
106106
ASSUME_ITS_EQUAL_CSTR(expected, result);
107107
free(result);
108108
}
@@ -177,15 +177,15 @@ FOSSIL_TEST_CASE(c_test_io_soap_sanitize_with_tabs) {
177177
FOSSIL_TEST_CASE(c_test_io_soap_suggest_leetspeak) {
178178
const char *input = "Th1s 1s 4 l33tspeak s3nt3nc3.";
179179
const char *expected = "This is a leetspeak sentence.";
180-
char *result = fossil_io_soap_suggest(input, '*');
180+
char *result = fossil_io_soap_suggest(input);
181181
ASSUME_ITS_EQUAL_CSTR(expected, result);
182182
free(result);
183183
}
184184

185185
FOSSIL_TEST_CASE(c_test_io_soap_suggest_mixed_case) {
186186
const char *input = "This Is A Rot-Brain Sentence.";
187187
const char *expected = "This Is A stupid Sentence.";
188-
char *result = fossil_io_soap_suggest(input, '*');
188+
char *result = fossil_io_soap_suggest(input);
189189

190190
ASSUME_ITS_EQUAL_CSTR(expected, result);
191191
free(result);
@@ -194,23 +194,23 @@ FOSSIL_TEST_CASE(c_test_io_soap_suggest_mixed_case) {
194194
FOSSIL_TEST_CASE(c_test_io_soap_suggest_with_special_chars) {
195195
const char *input = "This is a test with special chars #$%^&*!";
196196
const char *expected = "This is a test with special chars #$%^&*!";
197-
char *result = fossil_io_soap_suggest(input, '*');
197+
char *result = fossil_io_soap_suggest(input);
198198
ASSUME_ITS_EQUAL_CSTR(expected, result);
199199
free(result);
200200
}
201201

202202
FOSSIL_TEST_CASE(c_test_io_soap_suggest_with_newlines) {
203203
const char *input = "This is a test\nwith newlines.";
204204
const char *expected = "This is a test\nwith newlines.";
205-
char *result = fossil_io_soap_suggest(input, '*');
205+
char *result = fossil_io_soap_suggest(input);
206206
ASSUME_ITS_EQUAL_CSTR(expected, result);
207207
free(result);
208208
}
209209

210210
FOSSIL_TEST_CASE(c_test_io_soap_suggest_with_tabs) {
211211
const char *input = "This is a test\twith tabs.";
212212
const char *expected = "This is a test\twith tabs.";
213-
char *result = fossil_io_soap_suggest(input, '*');
213+
char *result = fossil_io_soap_suggest(input);
214214
ASSUME_ITS_EQUAL_CSTR(expected, result);
215215
free(result);
216216
}

code/tests/cases/test_soap.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_sanitize_long_input) {
9494
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest) {
9595
const char *input = "This is a rot-brain sentence.";
9696
const char *expected = "This is a stupid sentence.";
97-
char *result = fossil_io_soap_suggest(input, '*');
97+
char *result = fossil_io_soap_suggest(input);
9898
ASSUME_ITS_EQUAL_CSTR(expected, result);
9999
free(result);
100100
}
101101

102102
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_no_offensive) {
103103
const char *input = "This is a clean sentence.";
104104
const char *expected = "This is a clean sentence.";
105-
char *result = fossil_io_soap_suggest(input, '*');
105+
char *result = fossil_io_soap_suggest(input);
106106
ASSUME_ITS_EQUAL_CSTR(expected, result);
107107
free(result);
108108
}
@@ -177,15 +177,15 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_sanitize_with_tabs) {
177177
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_leetspeak) {
178178
const char *input = "Th1s 1s 4 l33tspeak s3nt3nc3.";
179179
const char *expected = "This is a leetspeak sentence.";
180-
char *result = fossil_io_soap_suggest(input, '*');
180+
char *result = fossil_io_soap_suggest(input);
181181
ASSUME_ITS_EQUAL_CSTR(expected, result);
182182
free(result);
183183
}
184184

185185
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_mixed_case) {
186186
const char *input = "This Is A Rot-Brain Sentence.";
187187
const char *expected = "This Is A stupid Sentence.";
188-
char *result = fossil_io_soap_suggest(input, '*');
188+
char *result = fossil_io_soap_suggest(input);
189189

190190
ASSUME_ITS_EQUAL_CSTR(expected, result);
191191
free(result);
@@ -194,23 +194,23 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_mixed_case) {
194194
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_special_chars) {
195195
const char *input = "This is a test with special chars #$%^&*!";
196196
const char *expected = "This is a test with special chars #$%^&*!";
197-
char *result = fossil_io_soap_suggest(input, '*');
197+
char *result = fossil_io_soap_suggest(input);
198198
ASSUME_ITS_EQUAL_CSTR(expected, result);
199199
free(result);
200200
}
201201

202202
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_newlines) {
203203
const char *input = "This is a test\nwith newlines.";
204204
const char *expected = "This is a test\nwith newlines.";
205-
char *result = fossil_io_soap_suggest(input, '*');
205+
char *result = fossil_io_soap_suggest(input);
206206
ASSUME_ITS_EQUAL_CSTR(expected, result);
207207
free(result);
208208
}
209209

210210
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_tabs) {
211211
const char *input = "This is a test\twith tabs.";
212212
const char *expected = "This is a test\twith tabs.";
213-
char *result = fossil_io_soap_suggest(input, '*');
213+
char *result = fossil_io_soap_suggest(input);
214214
ASSUME_ITS_EQUAL_CSTR(expected, result);
215215
free(result);
216216
}
@@ -260,14 +260,14 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_sanitize_long_input_stl) {
260260
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_stl) {
261261
std::string input = "This is a rot-brain sentence.";
262262
std::string expected = "This is a stupid sentence.";
263-
std::string result = fossil::io::Soap::suggest(input, '*');
263+
std::string result = fossil::io::Soap::suggest(input);
264264
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
265265
}
266266

267267
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_no_offensive_stl) {
268268
std::string input = "This is a clean sentence.";
269269
std::string expected = "This is a clean sentence.";
270-
std::string result = fossil::io::Soap::suggest(input, '*');
270+
std::string result = fossil::io::Soap::suggest(input);
271271
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
272272
}
273273

@@ -336,35 +336,35 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_sanitize_with_tabs_stl) {
336336
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_leetspeak_stl) {
337337
std::string input = "Th1s 1s 4 l33tspeak s3nt3nc3.";
338338
std::string expected = "This is a leetspeak sentence.";
339-
std::string result = fossil::io::Soap::suggest(input, '*');
339+
std::string result = fossil::io::Soap::suggest(input);
340340
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
341341
}
342342

343343
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_mixed_case_stl) {
344344
std::string input = "This Is A Rot-Brain Sentence.";
345345
std::string expected = "This Is A stupid Sentence.";
346-
std::string result = fossil::io::Soap::suggest(input, '*');
346+
std::string result = fossil::io::Soap::suggest(input);
347347
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
348348
}
349349

350350
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_special_chars_stl) {
351351
std::string input = "This is a test with special chars #$%^&*!";
352352
std::string expected = "This is a test with special chars #$%^&*!";
353-
std::string result = fossil::io::Soap::suggest(input, '*');
353+
std::string result = fossil::io::Soap::suggest(input);
354354
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
355355
}
356356

357357
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_newlines_stl) {
358358
std::string input = "This is a test\nwith newlines.";
359359
std::string expected = "This is a test\nwith newlines.";
360-
std::string result = fossil::io::Soap::suggest(input, '*');
360+
std::string result = fossil::io::Soap::suggest(input);
361361
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
362362
}
363363

364364
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_tabs_stl) {
365365
std::string input = "This is a test\twith tabs.";
366366
std::string expected = "This is a test\twith tabs.";
367-
std::string result = fossil::io::Soap::suggest(input, '*');
367+
std::string result = fossil::io::Soap::suggest(input);
368368
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
369369
}
370370

@@ -419,15 +419,15 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_sanitize_long_input_cstr) {
419419
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_cstr) {
420420
const char *input = "This is a rot-brain sentence.";
421421
const char *expected = "This is a stupid sentence.";
422-
char *result = fossil::io::Soap::suggest(input, '*');
422+
char *result = fossil::io::Soap::suggest(input);
423423
ASSUME_ITS_EQUAL_CSTR(expected, result);
424424
free(result);
425425
}
426426

427427
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_no_offensive_cstr) {
428428
const char *input = "This is a clean sentence.";
429429
const char *expected = "This is a clean sentence.";
430-
char *result = fossil::io::Soap::suggest(input, '*');
430+
char *result = fossil::io::Soap::suggest(input);
431431
ASSUME_ITS_EQUAL_CSTR(expected, result);
432432
free(result);
433433
}
@@ -502,39 +502,39 @@ FOSSIL_TEST_CASE(cpp_test_io_soap_sanitize_with_tabs_cstr) {
502502
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_leetspeak_cstr) {
503503
const char *input = "Th1s 1s 4 l33tspeak s3nt3nc3.";
504504
const char *expected = "This is a leetspeak sentence.";
505-
char *result = fossil::io::Soap::suggest(input, '*');
505+
char *result = fossil::io::Soap::suggest(input);
506506
ASSUME_ITS_EQUAL_CSTR(expected, result);
507507
free(result);
508508
}
509509

510510
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_mixed_case_cstr) {
511511
const char *input = "This Is A Rot-Brain Sentence.";
512512
const char *expected = "This Is A stupid Sentence.";
513-
char *result = fossil::io::Soap::suggest(input, '*');
513+
char *result = fossil::io::Soap::suggest(input);
514514
ASSUME_ITS_EQUAL_CSTR(expected, result);
515515
free(result);
516516
}
517517

518518
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_special_chars_cstr) {
519519
const char *input = "This is a test with special chars #$%^&*!";
520520
const char *expected = "This is a test with special chars #$%^&*!";
521-
char *result = fossil::io::Soap::suggest(input, '*');
521+
char *result = fossil::io::Soap::suggest(input);
522522
ASSUME_ITS_EQUAL_CSTR(expected, result);
523523
free(result);
524524
}
525525

526526
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_newlines_cstr) {
527527
const char *input = "This is a test\nwith newlines.";
528528
const char *expected = "This is a test\nwith newlines.";
529-
char *result = fossil::io::Soap::suggest(input, '*');
529+
char *result = fossil::io::Soap::suggest(input);
530530
ASSUME_ITS_EQUAL_CSTR(expected, result);
531531
free(result);
532532
}
533533

534534
FOSSIL_TEST_CASE(cpp_test_io_soap_suggest_with_tabs_cstr) {
535535
const char *input = "This is a test\twith tabs.";
536536
const char *expected = "This is a test\twith tabs.";
537-
char *result = fossil::io::Soap::suggest(input, '*');
537+
char *result = fossil::io::Soap::suggest(input);
538538
ASSUME_ITS_EQUAL_CSTR(expected, result);
539539
free(result);
540540
}

0 commit comments

Comments
 (0)