Add a few const char*

This commit is contained in:
Christoffer Lerno
2026-02-12 16:51:34 +01:00
parent 3f279b2f1c
commit 27ceded331
3 changed files with 3 additions and 3 deletions

View File

@@ -332,7 +332,7 @@ void resolve_libraries(BuildTarget *build_target)
else
{
// Fallback to the arch in case of a common one, e.g. "macos-x64" -> "macos"
char *c = strchr(arch_os, '-');
const char *c = strchr(arch_os, '-');
if (c)
{
size_t to_remove = strlen(arch_os) - (c - arch_os);

View File

@@ -148,7 +148,7 @@ static void linker_setup_windows(const char ***args_ref, Linker linker_type, con
{
if (compiler.build.win.vs_dirs)
{
char *c = strstr(compiler.build.win.vs_dirs, ";");
const char *c = strstr(compiler.build.win.vs_dirs, ";");
int len = (int)(c - compiler.build.win.vs_dirs);
if (!c || !len) error_exit("''win-vs-dirs' override was invalid.");
char *um = str_printf("%.*s\\um\\x64", len, compiler.build.win.vs_dirs);

View File

@@ -388,7 +388,7 @@ bool sema_expr_analyse_str_find(SemaContext *context, Expr *expr)
}
const char *inner_str = inner->const_expr.bytes.ptr;
const char *find_str = inner_find->const_expr.bytes.ptr;
char *ret = strstr(inner_str, find_str);
const char *ret = strstr(inner_str, find_str);
expr_rewrite_const_int(expr, type_isz, (uint64_t)(ret == NULL ? -1 : ret - inner_str));
return true;
}