summarylogtreecommitdiffstats
path: root/fix_build_with_gcc_14.1.diff
blob: 6aad954590047d130b0855cea2c655ab9c523a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff --git a/server/repo-op.c b/server/repo-op.c
index f933f59..145de21 100644
--- a/server/repo-op.c
+++ b/server/repo-op.c
@@ -1024,7 +1024,7 @@ check_files_with_same_name (SeafRepo *repo, const char *parent_dir, GList *filen
     char *canon_path = NULL;
     SeafCommit *commit = NULL;
     SeafDir *dir = NULL;
-    GError *error = NULL;
+    GError **error = NULL;
     gboolean ret = FALSE;
 
     GET_COMMIT_OR_FAIL(commit, repo->id, repo->version, repo->head->commit_id);
@@ -1034,7 +1034,7 @@ check_files_with_same_name (SeafRepo *repo, const char *parent_dir, GList *filen
     dir = seaf_fs_manager_get_seafdir_by_path (seaf->fs_mgr,
                                                repo->store_id, repo->version,
                                                commit->root_id,
-                                               canon_path, &error);
+                                               canon_path, error);
     if (!dir) {
         goto out;
     }
@@ -1051,7 +1051,7 @@ check_files_with_same_name (SeafRepo *repo, const char *parent_dir, GList *filen
         g_free (unique_name);
     }
 out:
-    g_clear_error (&error);
+    g_clear_error (error);
     g_free (canon_path);
     seaf_dir_free (dir);
     seaf_commit_unref (commit);
@@ -6531,7 +6531,7 @@ hash_to_list (gpointer key, gpointer value, gpointer user_data)
 }
 
 static gint
-compare_commit_by_time (gconstpointer a, gconstpointer b, gpointer unused)
+compare_commit_by_time (gconstpointer a, gconstpointer b)
 {
     const SeafCommit *commit_a = a;
     const SeafCommit *commit_b = b;
@@ -6540,6 +6540,12 @@ compare_commit_by_time (gconstpointer a, gconstpointer b, gpointer unused)
     return (commit_b->ctime - commit_a->ctime);
 }
 
+static gint
+compare_data_commit_by_time (gconstpointer a, gconstpointer b, gpointer unused)
+{
+    return compare_commit_by_time (a, b);
+}
+
 static int
 insert_parent_commit (GList **list, GHashTable *hash,
                       const char *repo_id, int version,
@@ -6560,7 +6566,7 @@ insert_parent_commit (GList **list, GHashTable *hash,
     }
 
     *list = g_list_insert_sorted_with_data (*list, p,
-                                           compare_commit_by_time,
+                                           compare_data_commit_by_time,
                                            NULL);
 
     key = g_strdup (parent_id);