summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2018-09-16 18:37:05 +0200
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2018-09-16 18:37:05 +0200
commita9e8810f90862bc14d268169011bfad37a6d7c90 (patch)
tree4c003737419f3a6a784ea7417c14ff3f8d3afd16
parent79a85ebb17ceddef5b5f093549681506abf524c2 (diff)
downloadccache-a9e8810f90862bc14d268169011bfad37a6d7c90.tar.gz
Add missing extern prototypes, or make static
-rw-r--r--configure.ac4
-rw-r--r--dev.mk.in2
-rw-r--r--src/ccache.c12
-rw-r--r--src/cleanup.c2
-rw-r--r--src/compopt.c2
-rw-r--r--src/hashtable.c4
-rw-r--r--src/hashtable_itr.c1
-rw-r--r--src/hashtable_private.h2
-rw-r--r--src/language.c2
-rw-r--r--src/util.c2
-rw-r--r--unittest/framework.h1
-rw-r--r--unittest/main.c2
-rw-r--r--unittest/test_compopt.c2
13 files changed, 30 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index af0e6323..9a65f85d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.
diff --git a/dev.mk.in b/dev.mk.in
index c992466b..9e260cd2 100644
--- 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
diff --git a/src/ccache.c b/src/ccache.c
index 49ebc8e3..592158bc 100644
--- a/src/ccache.c
+++ b/src/ccache.c
@@ -33,6 +33,15 @@
#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
diff --git a/src/cleanup.c b/src/cleanup.c
index 607e5dbb..676afc2e 100644
--- a/src/cleanup.c
+++ b/src/cleanup.c
@@ -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);
diff --git a/src/compopt.c b/src/compopt.c
index 63351acb..b250c3be 100644
--- a/src/compopt.c
+++ b/src/compopt.c
@@ -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)
diff --git a/src/hashtable.c b/src/hashtable.c
index da40cc2f..19eff8f4 100644
--- a/src/hashtable.c
+++ b/src/hashtable.c
@@ -30,12 +30,16 @@
*/
#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/
diff --git a/src/hashtable_itr.c b/src/hashtable_itr.c
index 5dced841..1ee43da0 100644
--- a/src/hashtable_itr.c
+++ b/src/hashtable_itr.c
@@ -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 */
diff --git a/src/hashtable_private.h b/src/hashtable_private.h
index 5d765d62..260afcab 100644
--- a/src/hashtable_private.h
+++ b/src/hashtable_private.h
@@ -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)
diff --git a/src/language.c b/src/language.c
index 8d4321dc..fb72411f 100644
--- a/src/language.c
+++ b/src/language.c
@@ -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 {
diff --git a/src/util.c b/src/util.c
index e8632317..7efbea4b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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"
diff --git a/unittest/framework.h b/unittest/framework.h
index 2f36c736..940b2fec 100644
--- a/unittest/framework.h
+++ b/unittest/framework.h
@@ -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; \
diff --git a/unittest/main.c b/unittest/main.c
index 7b59788a..e2da341d 100644
--- a/unittest/main.c
+++ b/unittest/main.c
@@ -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"
diff --git a/unittest/test_compopt.c b/unittest/test_compopt.c
index fb50f357..6b581211 100644
--- a/unittest/test_compopt.c
+++ b/unittest/test_compopt.c
@@ -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());
}