mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
ci: Fix cases of -Werror=discarded-qualifiers raised by gcc 15.2
This commit is contained in:
@@ -50,7 +50,7 @@ GIT_INLINE(const cli_opt_spec *) spec_for_long(
|
||||
const char *arg)
|
||||
{
|
||||
const cli_opt_spec *spec;
|
||||
char *eql;
|
||||
const char *eql;
|
||||
size_t eql_pos;
|
||||
|
||||
eql = strchr(arg, '=');
|
||||
|
||||
@@ -811,7 +811,7 @@ int git_attr_fnmatch__parse(
|
||||
}
|
||||
|
||||
if (context) {
|
||||
char *slash = strrchr(context, '/');
|
||||
const char *slash = strrchr(context, '/');
|
||||
size_t len;
|
||||
if (slash) {
|
||||
/* include the slash for easier matching */
|
||||
|
||||
@@ -1135,7 +1135,8 @@ static int config_file_write(
|
||||
const char *value)
|
||||
|
||||
{
|
||||
char *orig_section = NULL, *section = NULL, *orig_name, *name, *ldot;
|
||||
char *orig_section = NULL, *section = NULL;
|
||||
const char *orig_name, *name, *ldot;
|
||||
git_str buf = GIT_STR_INIT, contents = GIT_STR_INIT;
|
||||
git_config_parser parser = GIT_CONFIG_PARSER_INIT;
|
||||
git_filebuf file = GIT_FILEBUF_INIT;
|
||||
|
||||
@@ -282,7 +282,8 @@ static int skip_bom(git_parse_ctx *parser)
|
||||
/* '\"' -> '"' etc */
|
||||
static int unescape_line(char **out, bool *is_multi, const char *ptr, int *quote_count)
|
||||
{
|
||||
char *str, *fixed, *esc;
|
||||
char *str, *fixed;
|
||||
const char *esc;
|
||||
size_t ptr_len = strlen(ptr), alloc_len;
|
||||
|
||||
*is_multi = false;
|
||||
|
||||
@@ -33,7 +33,7 @@ static int git_message__prettify(
|
||||
|
||||
int consecutive_empty_lines = 0;
|
||||
size_t i, line_length, rtrimmed_line_length;
|
||||
char *next_newline;
|
||||
const char *next_newline;
|
||||
|
||||
for (i = 0; i < strlen(message); i += line_length) {
|
||||
next_newline = memchr(message + i, '\n', message_len - i);
|
||||
|
||||
@@ -39,7 +39,7 @@ typedef struct {
|
||||
*/
|
||||
static int gen_proto(git_str *request, const char *cmd, const char *url)
|
||||
{
|
||||
char *delim, *repo;
|
||||
const char *delim, *repo;
|
||||
char host[] = "host=";
|
||||
size_t len;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ struct git_process {
|
||||
|
||||
GIT_INLINE(bool) is_delete_env(const char *env)
|
||||
{
|
||||
char *c = strchr(env, '=');
|
||||
const char *c = strchr(env, '=');
|
||||
|
||||
if (c == NULL)
|
||||
return false;
|
||||
|
||||
@@ -336,7 +336,7 @@ char *git__strsep(char **end, const char *sep)
|
||||
|
||||
size_t git__linenlen(const char *buffer, size_t buffer_len)
|
||||
{
|
||||
char *nl = memchr(buffer, '\n', buffer_len);
|
||||
const char *nl = memchr(buffer, '\n', buffer_len);
|
||||
return nl ? (size_t)(nl - buffer) + 1 : buffer_len;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ static void clar_print_tap_error(int num, const struct clar_report *report, cons
|
||||
|
||||
static void print_escaped(const char *str)
|
||||
{
|
||||
char *c;
|
||||
const char *c;
|
||||
|
||||
while ((c = strchr(str, '\'')) != NULL) {
|
||||
printf("%.*s", (int)(c - str), str);
|
||||
|
||||
@@ -18,7 +18,7 @@ void test_diff_drivers__cleanup(void)
|
||||
static void overwrite_filemode(const char *expected, git_buf *actual)
|
||||
{
|
||||
size_t offset;
|
||||
char *found;
|
||||
const char *found;
|
||||
|
||||
found = strstr(expected, "100644");
|
||||
if (!found)
|
||||
|
||||
@@ -244,7 +244,7 @@ void test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_succeeds(void
|
||||
*/
|
||||
cl_git_pass(git_str_join_n(&logpath, '/', 3, git_repository_path(g_repo), GIT_REFLOG_DIR, refname));
|
||||
cl_git_pass(git_futils_readbuffer(&logcontents, git_str_cstr(&logpath)));
|
||||
cl_assert((star = strchr(git_str_cstr(&logcontents), '*')) != NULL);
|
||||
cl_assert((star = strchr(logcontents.ptr, '*')) != NULL);
|
||||
*star = '\n';
|
||||
cl_git_rewritefile(git_str_cstr(&logpath), git_str_cstr(&logcontents));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user