Code

Updates for dirty submodules in release notes and user manual
[git.git] / builtin-pack-objects.c
index 890f45cf2070a476c0325033e898e9345091fef1..4a41547a27fe0177efc13b81cd56e064d96d1ac3 100644 (file)
@@ -17,7 +17,7 @@
 #include "progress.h"
 #include "refs.h"
 
-#ifdef THREADED_DELTA_SEARCH
+#ifndef NO_PTHREADS
 #include "thread-utils.h"
 #include <pthread.h>
 #endif
@@ -525,7 +525,8 @@ static void write_pack_file(void)
                if (!pack_to_stdout) {
                        mode_t mode = umask(0);
                        struct stat st;
-                       char *idx_tmp_name, tmpname[PATH_MAX];
+                       const char *idx_tmp_name;
+                       char tmpname[PATH_MAX];
 
                        umask(mode);
                        mode = 0444 & ~mode;
@@ -569,7 +570,7 @@ static void write_pack_file(void)
                        if (rename(idx_tmp_name, tmpname))
                                die_errno("unable to rename temporary index file");
 
-                       free(idx_tmp_name);
+                       free((void *) idx_tmp_name);
                        free(pack_tmp_name);
                        puts(sha1_to_hex(sha1));
                }
@@ -673,7 +674,7 @@ static void setup_delta_attr_check(struct git_attr_check *check)
        static struct git_attr *attr_delta;
 
        if (!attr_delta)
-               attr_delta = git_attr("delta", 5);
+               attr_delta = git_attr("delta");
 
        check[0].attr = attr_delta;
 }
@@ -1254,7 +1255,7 @@ static int delta_cacheable(unsigned long src_size, unsigned long trg_size,
        return 0;
 }
 
-#ifdef THREADED_DELTA_SEARCH
+#ifndef NO_PTHREADS
 
 static pthread_mutex_t read_mutex;
 #define read_lock()            pthread_mutex_lock(&read_mutex)
@@ -1379,7 +1380,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
        /*
         * Handle memory allocation outside of the cache
         * accounting lock.  Compiler will optimize the strangeness
-        * away when THREADED_DELTA_SEARCH is not defined.
+        * away when NO_PTHREADS is defined.
         */
        free(trg_entry->delta_data);
        cache_lock();
@@ -1566,7 +1567,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
        free(array);
 }
 
-#ifdef THREADED_DELTA_SEARCH
+#ifndef NO_PTHREADS
 
 /*
  * The main thread waits on the condition that (at least) one of the workers
@@ -1898,7 +1899,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
                if (delta_search_threads < 0)
                        die("invalid number of threads specified (%d)",
                            delta_search_threads);
-#ifndef THREADED_DELTA_SEARCH
+#ifdef NO_PTHREADS
                if (delta_search_threads != 1)
                        warning("no threads support, ignoring %s", k);
 #endif
@@ -2226,7 +2227,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                        delta_search_threads = strtoul(arg+10, &end, 0);
                        if (!arg[10] || *end || delta_search_threads < 0)
                                usage(pack_usage);
-#ifndef THREADED_DELTA_SEARCH
+#ifdef NO_PTHREADS
                        if (delta_search_threads != 1)
                                warning("no threads support, "
                                        "ignoring %s", arg);