]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add missing extern prototypes, or make static
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:37:05 +0000 (18:37 +0200)
committerAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:37:05 +0000 (18:37 +0200)
13 files changed:
configure.ac
dev.mk.in
src/ccache.c
src/cleanup.c
src/compopt.c
src/hashtable.c
src/hashtable_itr.c
src/hashtable_private.h
src/language.c
src/util.c
unittest/framework.h
unittest/main.c
unittest/test_compopt.c

index af0e6323cb66eceb9bc50a99e14b8de6285cb848..9a65f85d49c161f67cb1f7e34645f5922926a9db 100644 (file)
@@ -176,14 +176,14 @@ if test ! -f $srcdir/dev_mode_disabled && test "$RUN_FROM_BUILD_FARM" != yes; th
     AC_CONFIG_FILES([dev.mk])
     include_dev_mk='include dev.mk'
     version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
-    echo "const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
+    echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
 else
     AC_MSG_NOTICE(developer mode disabled)
 fi
 
 if test ! -f $srcdir/src/version.c -a ! -f src/version.c ; then
     AC_MSG_WARN(unable to determine ccache version)
-    echo "const char CCACHE_VERSION@<:@@:>@ = \"unknown\";" >src/version.c
+    echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"unknown\";" >src/version.c
 fi
 
 dnl Find test suite files.
index c992466b1f9668bb4ca43cd6985034e3754892ed..9e260cd2978398345b4e0967d9c7da52d1c0d93a 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -102,7 +102,7 @@ uncrustify_exclude_files = \
     src/snprintf.c
 
 ifneq ($(shell sed 's/.*"\(.*\)".*/\1/' src/version.c 2>/dev/null),$(version))
-  $(shell echo 'const char CCACHE_VERSION[] = "$(version)";' >src/version.c)
+  $(shell echo 'extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "$(version)";' >src/version.c)
 endif
 src/version.o: src/version.c
 
index 49ebc8e37631cf5851b313352112ec8534f8334e..592158bca1a88785f8f5cdcc20739e0a8a021950 100644 (file)
 #define STRINGIFY(x) #x
 #define TO_STRING(x) STRINGIFY(x)
 
+extern struct conf *conf;
+extern char *primary_config_path;
+extern char *secondary_config_path;
+extern char *current_working_dir;
+extern char *stats_file;
+extern unsigned lock_staleness_limit;
+
+int ccache_main(int argc, char *argv[]);
+
 static const char VERSION_TEXT[] =
   MYNAME " version %s\n"
   "\n"
@@ -1157,7 +1166,8 @@ send_cached_stderr(void)
 }
 
 // Create or update the manifest file.
-void update_manifest_file(void)
+static void
+update_manifest_file(void)
 {
        if (!conf->direct_mode
            || !included_files
index 607e5dbba2369fd56b2cca5beaa966cf15e6b425..676afc2ed81dc74459eb7956ab1ea342ef0a01d9 100644 (file)
@@ -238,7 +238,7 @@ static void wipe_fn(const char *fname, struct stat *st)
 }
 
 // Wipe one cache subdirectory.
-void
+static void
 wipe_dir(const char *dir)
 {
        cc_log("Clearing out cache directory %s", dir);
index 63351acb0a6798062423262d24608bb4fa6cc25d..b250c3beebdb27551a680b0ae3207aa3cf47bc73 100644 (file)
@@ -142,6 +142,8 @@ compopt_short(bool (*fn)(const char *), const char *option)
        return retval;
 }
 
+extern bool compopt_verify_sortedness(void);
+
 // For test purposes.
 bool
 compopt_verify_sortedness(void)
index da40cc2f8c95423593e376fd771ca56b58eb76de..19eff8f440af8ade54d175f52fec04b86aa6d9ff 100644 (file)
 */
 
 #include "hashtable.h"
+#define HASHTABLE_INDEXFOR
 #include "hashtable_private.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
 
+extern const unsigned int prime_table_length;
+extern const float max_load_factor;
+
 /*
 Credit for primes table: Aaron Krowne
  http://br.endernet.org/~akrowne/
index 5dced841f31d447c83b1a73cdfa42d2fb1c271c9..1ee43da0c65451392732853c70deaff6242ae5df 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
 
 #include "hashtable.h"
+#define HASHTABLE_INDEXFOR
 #include "hashtable_private.h"
 #include "hashtable_itr.h"
 #include <stdlib.h> /* defines NULL */
index 5d765d62d380a78125ca1d0ec641410b16672695..260afcab9197392e1ce16857bf3bfcf714598d94 100644 (file)
@@ -28,6 +28,7 @@ unsigned int
 hash(struct hashtable *h, void *k);
 
 /*****************************************************************************/
+#ifdef HASHTABLE_INDEXFOR
 /* indexFor */
 static inline unsigned int
 indexFor(unsigned int tablelength, unsigned int hashvalue) {
@@ -41,6 +42,7 @@ indexFor(unsigned int tablelength, unsigned int hashvalue)
     return (hashvalue & (tablelength - 1u));
 }
 */
+#endif
 
 /*****************************************************************************/
 #define freekey(X) free(X)
index 8d4321dc955194bb5f6f22a50227d2e87ea68650..fb72411f42cd0aed0d807d80e746d8e3aacba932 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "ccache.h"
 
+#include "language.h"
+
 // Supported file extensions and corresponding languages (as in parameter to
 // the -x option).
 static const struct {
index e86323175119cbb2b8321d8ef911ff48a63686af..7efbea4b6ba61f9bdcc8c635c3656b695de424fe 100644 (file)
@@ -578,7 +578,7 @@ format_hash_as_string(const unsigned char *hash, int size)
        return ret;
 }
 
-char const CACHEDIR_TAG[] =
+static char const CACHEDIR_TAG[] =
   "Signature: 8a477f597d28d172789f06886806bc55\n"
   "# This file is a cache directory tag created by ccache.\n"
   "# For information about cache directory tags, see:\n"
index 2f36c736ef1904071423fd7956016b4bdef609c7..940b2fec787c9bd51e5272364306f5301a4be5b4 100644 (file)
@@ -22,6 +22,7 @@
 // ============================================================================
 
 #define TEST_SUITE(name) \
+       extern unsigned suite_##name(unsigned _start_point); \
        unsigned suite_##name(unsigned _start_point) \
        { \
                unsigned _test_counter = 0; \
index 7b59788a68003b23e1cfb71942894e242b8ad56c..e2da341dd831f07a31f48cfbac773157332f8a83 100644 (file)
@@ -27,7 +27,7 @@
 #undef SUITE
 // *INDENT-ON* enable uncrustify
 
-const char USAGE_TEXT[] =
+static const char USAGE_TEXT[] =
   "Usage:\n"
   "    test [options]\n"
   "\n"
index fb50f357b68c9ea9f03062e85c621351bb7eed2c..6b58121172a017f1ed6973c927f0cfcfc0a7b239 100644 (file)
@@ -24,7 +24,7 @@ TEST_SUITE(compopt)
 
 TEST(option_table_should_be_sorted)
 {
-       bool compopt_verify_sortedness();
+       extern bool compopt_verify_sortedness(void);
        CHECK(compopt_verify_sortedness());
 }