pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/libgit2/libgit2/commit/fadbef196e770804eead349e40d17d2fb7fcf4fa

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7a1ad343bd40328c.css" /> ci: Fix cases of -Werror=discarded-qualifiers raised by gcc 15.2 · libgit2/libgit2@fadbef1 · GitHub
Skip to content

Commit fadbef1

Browse files
committed
ci: Fix cases of -Werror=discarded-qualifiers raised by gcc 15.2
1 parent 610dcaa commit fadbef1

11 files changed

Lines changed: 13 additions & 11 deletions

File tree

src/cli/opt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ GIT_INLINE(const cli_opt_spec *) spec_for_long(
5050
const char *arg)
5151
{
5252
const cli_opt_spec *spec;
53-
char *eql;
53+
const char *eql;
5454
size_t eql_pos;
5555

5656
eql = strchr(arg, '=');

src/libgit2/attr_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ int git_attr_fnmatch__parse(
811811
}
812812

813813
if (context) {
814-
char *slash = strrchr(context, '/');
814+
const char *slash = strrchr(context, '/');
815815
size_t len;
816816
if (slash) {
817817
/* include the slash for easier matching */

src/libgit2/config_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,8 @@ static int config_file_write(
11351135
const char *value)
11361136

11371137
{
1138-
char *orig_section = NULL, *section = NULL, *orig_name, *name, *ldot;
1138+
char *orig_section = NULL, *section = NULL;
1139+
const char *orig_name, *name, *ldot;
11391140
git_str buf = GIT_STR_INIT, contents = GIT_STR_INIT;
11401141
git_config_parser parser = GIT_CONFIG_PARSER_INIT;
11411142
git_filebuf file = GIT_FILEBUF_INIT;

src/libgit2/config_parse.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ static int skip_bom(git_parse_ctx *parser)
282282
/* '\"' -> '"' etc */
283283
static int unescape_line(char **out, bool *is_multi, const char *ptr, int *quote_count)
284284
{
285-
char *str, *fixed, *esc;
285+
char *str, *fixed;
286+
const char *esc;
286287
size_t ptr_len = strlen(ptr), alloc_len;
287288

288289
*is_multi = false;

src/libgit2/message.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int git_message__prettify(
3333

3434
int consecutive_empty_lines = 0;
3535
size_t i, line_length, rtrimmed_line_length;
36-
char *next_newline;
36+
const char *next_newline;
3737

3838
for (i = 0; i < strlen(message); i += line_length) {
3939
next_newline = memchr(message + i, '\n', message_len - i);

src/libgit2/transports/git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ typedef struct {
3939
*/
4040
static int gen_proto(git_str *request, const char *cmd, const char *url)
4141
{
42-
char *delim, *repo;
42+
const char *delim, *repo;
4343
char host[] = "host=";
4444
size_t len;
4545

src/util/unix/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct git_process {
4444

4545
GIT_INLINE(bool) is_delete_env(const char *env)
4646
{
47-
char *c = strchr(env, '=');
47+
const char *c = strchr(env, '=');
4848

4949
if (c == NULL)
5050
return false;

src/util/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ char *git__strsep(char **end, const char *sep)
336336

337337
size_t git__linenlen(const char *buffer, size_t buffer_len)
338338
{
339-
char *nl = memchr(buffer, '\n', buffer_len);
339+
const char *nl = memchr(buffer, '\n', buffer_len);
340340
return nl ? (size_t)(nl - buffer) + 1 : buffer_len;
341341
}
342342

tests/clar/clar/print.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static void clar_print_tap_error(int num, const struct clar_report *report, cons
102102

103103
static void print_escaped(const char *str)
104104
{
105-
char *c;
105+
const char *c;
106106

107107
while ((c = strchr(str, '\'')) != NULL) {
108108
printf("%.*s", (int)(c - str), str);

tests/libgit2/diff/drivers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void test_diff_drivers__cleanup(void)
1818
static void overwrite_filemode(const char *expected, git_buf *actual)
1919
{
2020
size_t offset;
21-
char *found;
21+
const char *found;
2222

2323
found = strstr(expected, "100644");
2424
if (!found)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy