Fix warnings on clang (literally 95% implicit conversion to char* from const char*)#

This commit is contained in:
2026-09-02 09:07:16 +02:00
parent 3d6b08d9d5
commit fcf510afa4
9 changed files with 35 additions and 1152 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ void hammy_cmd_abbr(const hammy_job_t* job, struct discord* client, hammy_refdb_
return;
}
hammy_to_uppercase(abbr);
hammy_to_uppercase((char*)abbr);
snprintf(body, sizeof(body), "Abbreviation: `%s`\nMeaning: `%s`\nUsage Context: `%s`", abbr, (str ? str : "Not Specified"), (context ? context : "Not Specified"));
+3
View File
@@ -30,7 +30,10 @@ static void sb_addf(hammy_sb_t* sb, const char* fmt, ...) {
va_list ap;
va_start(ap, fmt);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
int n = vsnprintf(sb->buf + sb->len, sb->cap - sb->len, fmt, ap);
#pragma clang diagnostic pop
va_end(ap);
if (n < 0) {
+1 -1
View File
@@ -130,7 +130,7 @@ void hammy_cmd_phonetic(const hammy_job_t* job, struct discord* client, hammy_re
memcpy(pronunciation + pronunciationLen, HAMMY_PHONETIC_TRUNCATED, sizeof(HAMMY_PHONETIC_TRUNCATED));
}
hammy_to_uppercase(text);
hammy_to_uppercase((char*)text);
// Reply with the phonetic words and how each of them is spoken.
char body[sizeof(phonetic) + sizeof(pronunciation) + 48];
+1 -1
View File
@@ -32,7 +32,7 @@ void hammy_cmd_q(const hammy_job_t* job, struct discord* client, hammy_refdb_t*
return;
}
hammy_to_uppercase(qcode);
hammy_to_uppercase((char*)qcode);
snprintf(body, sizeof(body), "Q-Code: `%s`\nQuestion: `%s`\nAnswer: `%s`", qcode, (questionStr ? questionStr : "Not Specified"), (answerStr ? answerStr : "Not Specified"));