Commit ba1de1af932e59c8cb4cdafd9a057b1e07471730

Kirill A. Shutemov 2011-07-15T15:29:13

transport_local: fix cast warnings home/kas/git/public/libgit2/src/transport_local.c: In function ‘cmp_refs’: /home/kas/git/public/libgit2/src/transport_local.c:19:22: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/src/transport_local.c:20:22: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/transport_local.c b/src/transport_local.c
index a9f6678..64ac183 100644
--- a/src/transport_local.c
+++ b/src/transport_local.c
@@ -16,8 +16,8 @@ typedef struct {
 
 static int cmp_refs(const void *a, const void *b)
 {
-	const char *stra = *(const char **) a;
-	const char *strb = *(const char **) b;
+	const char *stra = *(const char * const *) a;
+	const char *strb = *(const char * const *) b;
 
 	return strcmp(stra, strb);
 }