Fix compilation warnings of gitdll.c
authorSup Yut Sum <ch3cooli@gmail.com>
Wed, 27 Feb 2013 15:17:42 +0000 (27 23:17 +0800)
committerSup Yut Sum <ch3cooli@gmail.com>
Mon, 22 Apr 2013 12:51:02 +0000 (22 20:51 +0800)
Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
ext/gitdll/gitdll.c

index 21c8c99..ef7a99a 100644 (file)
@@ -56,7 +56,7 @@ Cgitdll::Cgitdll()
 #endif\r
 \r
 extern char g_last_error[];\r
-void * g_prefix;\r
+const char * g_prefix;\r
 \r
 char * get_git_last_error()\r
 {\r
@@ -89,7 +89,6 @@ static int convert_slash(char * path)
 int git_init()\r
 {\r
        char path[MAX_PATH+1];\r
-       char *prefix;\r
        int ret;\r
        size_t homesize;\r
 \r
@@ -108,7 +107,7 @@ int git_init()
        convert_slash(path);\r
 \r
        git_extract_argv0_path(path);\r
-       g_prefix = prefix = setup_git_directory();\r
+       g_prefix = setup_git_directory();\r
        ret = git_config(git_default_config, NULL);\r
 \r
        if (!homesize)\r
@@ -977,8 +976,8 @@ int git_checkout_file(const char *ref, const char *path, const char *outputpath)
 struct config_buf\r
 {\r
        char *buf;\r
-       char *key;\r
-       char *size;\r
+       const char *key;\r
+       size_t size;\r
        int seen;\r
 };\r
 \r
@@ -1156,10 +1155,10 @@ int git_read_mailmap(GIT_MAILMAP *mailmap)
                return -1;\r
 \r
        *mailmap = NULL;\r
-       if (!(map = (struct string_list *)calloc(1, sizeof(struct string_list))))\r
+       if ((map = (struct string_list *)calloc(1, sizeof(struct string_list))) == NULL)\r
                return -1;\r
 \r
-       if ((result = read_mailmap(map, NULL)))\r
+       if ((result = read_mailmap(map, NULL)) != 0)\r
                return result;\r
 \r
        *mailmap = map;\r
@@ -1188,7 +1187,7 @@ const char * git_get_mailmap_author(GIT_MAILMAP mailmap, const char *email2, voi
                        if (me->namemap.nr)\r
                        {\r
                                const char *author2 = author2_cb(payload);\r
-                               int j;\r
+                               unsigned int j;\r
                                for (j = 0; j < me->namemap.nr; ++j)\r
                                {\r
                                        struct string_list_item *sj = (struct string_list_item *)&me->namemap.items[j];\r