lib, programs: remove all unnecessary 'extern' keywords

'extern' on function declarations is redundant.
This commit is contained in:
Eric Biggers 2020-04-02 23:49:00 -07:00
parent 21ccbd2e2f
commit a735fa830f
6 changed files with 31 additions and 34 deletions

View File

@ -7,7 +7,7 @@
#include "lib_common.h"
extern void *aligned_malloc(size_t alignment, size_t size);
extern void aligned_free(void *ptr);
void *aligned_malloc(size_t alignment, size_t size);
void aligned_free(void *ptr);
#endif /* LIB_ALIGNED_MALLOC_H */

View File

@ -23,7 +23,7 @@
extern volatile u32 _cpu_features;
extern void setup_cpu_features(void);
void setup_cpu_features(void);
static inline u32 get_cpu_features(void)
{

View File

@ -8,7 +8,6 @@
struct libdeflate_compressor;
extern unsigned int
deflate_get_compression_level(struct libdeflate_compressor *c);
unsigned int deflate_get_compression_level(struct libdeflate_compressor *c);
#endif /* LIB_DEFLATE_COMPRESS_H */

View File

@ -27,7 +27,7 @@
extern volatile u32 _cpu_features;
extern void setup_cpu_features(void);
void setup_cpu_features(void);
static inline u32 get_cpu_features(void)
{

View File

@ -57,7 +57,7 @@
*/
#include <wchar.h>
extern int wmain(int argc, wchar_t **argv);
int wmain(int argc, wchar_t **argv);
# define tmain wmain
# define tchar wchar_t
# define _T(text) L##text
@ -116,12 +116,12 @@ extern int wmain(int argc, wchar_t **argv);
extern const tchar *program_invocation_name;
extern void _printf(1, 2) msg(const char *fmt, ...);
extern void _printf(1, 2) msg_errno(const char *fmt, ...);
void _printf(1, 2) msg(const char *fmt, ...);
void _printf(1, 2) msg_errno(const char *fmt, ...);
extern void *xmalloc(size_t size);
void *xmalloc(size_t size);
extern const tchar *get_filename(const tchar *path);
const tchar *get_filename(const tchar *path);
struct file_stream {
int fd;
@ -132,27 +132,26 @@ struct file_stream {
size_t mmap_size;
};
extern int xopen_for_read(const tchar *path, bool symlink_ok,
struct file_stream *strm);
extern int xopen_for_write(const tchar *path, bool force,
struct file_stream *strm);
extern int map_file_contents(struct file_stream *strm, u64 size);
int xopen_for_read(const tchar *path, bool symlink_ok,
struct file_stream *strm);
int xopen_for_write(const tchar *path, bool force, struct file_stream *strm);
int map_file_contents(struct file_stream *strm, u64 size);
extern ssize_t xread(struct file_stream *strm, void *buf, size_t count);
extern int full_write(struct file_stream *strm, const void *buf, size_t count);
ssize_t xread(struct file_stream *strm, void *buf, size_t count);
int full_write(struct file_stream *strm, const void *buf, size_t count);
extern int xclose(struct file_stream *strm);
int xclose(struct file_stream *strm);
extern int parse_compression_level(tchar opt_char, const tchar *arg);
int parse_compression_level(tchar opt_char, const tchar *arg);
extern struct libdeflate_compressor *alloc_compressor(int level);
extern struct libdeflate_decompressor *alloc_decompressor(void);
struct libdeflate_compressor *alloc_compressor(int level);
struct libdeflate_decompressor *alloc_decompressor(void);
/* tgetopt.c */
extern tchar *toptarg;
extern int toptind, topterr, toptopt;
extern int tgetopt(int argc, tchar *argv[], const tchar *optstring);
int tgetopt(int argc, tchar *argv[], const tchar *optstring);
#endif /* PROGRAMS_PROG_UTIL_H */

View File

@ -38,21 +38,21 @@
# define _noreturn
#endif
extern void _noreturn
void _noreturn
assertion_failed(const char *expr, const char *file, int line);
#define ASSERT(expr) { if (unlikely(!(expr))) \
assertion_failed(#expr, __FILE__, __LINE__); }
extern void begin_performance_test(void);
void begin_performance_test(void);
extern void alloc_guarded_buffer(size_t size, u8 **start_ret, u8 **end_ret);
extern void free_guarded_buffer(u8 *start, u8 *end);
void alloc_guarded_buffer(size_t size, u8 **start_ret, u8 **end_ret);
void free_guarded_buffer(u8 *start, u8 *end);
extern u64 timer_ticks(void);
extern u64 timer_ticks_to_ms(u64 ticks);
extern u64 timer_MB_per_s(u64 bytes, u64 ticks);
extern u64 timer_KB_per_s(u64 bytes, u64 ticks);
u64 timer_ticks(void);
u64 timer_ticks_to_ms(u64 ticks);
u64 timer_MB_per_s(u64 bytes, u64 ticks);
u64 timer_KB_per_s(u64 bytes, u64 ticks);
struct output_bitstream {
machine_word_t bitbuf;
@ -61,8 +61,7 @@ struct output_bitstream {
u8 *end;
};
extern bool put_bits(struct output_bitstream *os, machine_word_t bits,
int num_bits);
extern bool flush_bits(struct output_bitstream *os);
bool put_bits(struct output_bitstream *os, machine_word_t bits, int num_bits);
bool flush_bits(struct output_bitstream *os);
#endif /* PROGRAMS_TEST_UTIL_H */