fix -Wmissing-declaration warnings

This should result in a smaller size.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-06-29 16:42:21 -07:00
parent d6b8065c3b
commit 0df937e9c6
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
6 changed files with 17 additions and 15 deletions

2
cpr.c
View File

@ -47,6 +47,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "cpr.h"
#include <math.h>
#include <stdio.h>

View File

@ -102,7 +102,7 @@ void receiverPositionChanged(float lat, float lon, float alt)
//
// =============================== Initialization ===========================
//
void modesInitConfig(void) {
static void modesInitConfig(void) {
// Default everything to zero/NULL
memset(&Modes, 0, sizeof(Modes));
@ -127,7 +127,7 @@ void modesInitConfig(void) {
//
//=========================================================================
//
void modesInit(void) {
static void modesInit(void) {
int i;
pthread_mutex_init(&Modes.data_mutex,NULL);
@ -216,7 +216,7 @@ void modesInit(void) {
// without caring about data acquisition
//
void *readerThreadEntryPoint(void *arg)
static void *readerThreadEntryPoint(void *arg)
{
MODES_NOTUSED(arg);
@ -237,7 +237,7 @@ void *readerThreadEntryPoint(void *arg)
// Get raw IQ samples and filter everything is < than the specified level
// for more than 256 samples in order to reduce example file size
//
void snipMode(int level) {
static void snipMode(int level) {
int i, q;
uint64_t c = 0;
@ -255,7 +255,7 @@ void snipMode(int level) {
//
// ================================ Main ====================================
//
void showHelp(void) {
static void showHelp(void) {
printf("-----------------------------------------------------------------------------\n");
printf("| dump1090 ModeS Receiver %45s |\n", MODES_DUMP1090_VARIANT " " MODES_DUMP1090_VERSION);
@ -354,7 +354,7 @@ static void display_total_stats(void)
// perform tasks we need to do continuously, like accepting new clients
// from the net, refreshing the screen in interactive mode, and so forth
//
void backgroundTasks(void) {
static void backgroundTasks(void) {
static uint64_t next_stats_display;
static uint64_t next_stats_update;
static uint64_t next_json, next_history;

View File

@ -790,7 +790,7 @@ void modesQueueOutput(struct modesMessage *mm, struct aircraft *a) {
}
// Decode a little-endian IEEE754 float (binary32)
float ieee754_binary32_le_to_float(uint8_t *data)
static float ieee754_binary32_le_to_float(uint8_t *data)
{
double sign = (data[3] & 0x80) ? -1.0 : 1.0;
int16_t raw_exponent = ((data[3] & 0x7f) << 1) | ((data[2] & 0x80) >> 7);

View File

@ -267,7 +267,7 @@ bool rtlsdrOpen(void) {
static struct timespec rtlsdr_thread_cpu;
void rtlsdrCallback(unsigned char *buf, uint32_t len, void *ctx) {
static void rtlsdrCallback(unsigned char *buf, uint32_t len, void *ctx) {
struct mag_buf *outbuf;
struct mag_buf *lastbuf;
uint32_t slen;

View File

@ -61,7 +61,7 @@ uint32_t modeAC_age[4096];
// Return a new aircraft structure for the linked list of tracked
// aircraft
//
struct aircraft *trackCreateAircraft(struct modesMessage *mm) {
static struct aircraft *trackCreateAircraft(struct modesMessage *mm) {
static struct aircraft zeroAircraft;
struct aircraft *a = (struct aircraft *) malloc(sizeof(*a));
int i;
@ -142,7 +142,7 @@ struct aircraft *trackCreateAircraft(struct modesMessage *mm) {
// Return the aircraft with the specified address, or NULL if no aircraft
// exists with this address.
//
struct aircraft *trackFindAircraft(uint32_t addr) {
static struct aircraft *trackFindAircraft(uint32_t addr) {
struct aircraft *a = Modes.aircrafts;
while(a) {

View File

@ -31,7 +31,7 @@
//
// ============================= Utility functions ==========================
//
void sigintHandler(int dummy) {
static void sigintHandler(int dummy) {
MODES_NOTUSED(dummy);
signal(SIGINT, SIG_DFL); // reset signal handler - bit extra safety
Modes.exit = 1; // Signal to threads that we are done
@ -48,7 +48,7 @@ void receiverPositionChanged(float lat, float lon, float alt)
//
// =============================== Initialization ===========================
//
void view1090InitConfig(void) {
static void view1090InitConfig(void) {
// Default everything to zero/NULL
memset(&Modes, 0, sizeof(Modes));
@ -61,7 +61,7 @@ void view1090InitConfig(void) {
//
//=========================================================================
//
void view1090Init(void) {
static void view1090Init(void) {
pthread_mutex_init(&Modes.data_mutex,NULL);
pthread_cond_init(&Modes.data_cond,NULL);
@ -105,7 +105,7 @@ void view1090Init(void) {
//
// ================================ Main ====================================
//
void showHelp(void) {
static void showHelp(void) {
printf(
"-----------------------------------------------------------------------------\n"
"| view1090 ModeS Viewer %45s |\n"
@ -129,7 +129,7 @@ void showHelp(void) {
);
}
void sendSettings(struct client *c)
static void sendSettings(struct client *c)
{
sendBeastSettings(c, "CdV"); // Beast binary format, no filters, verbatim mode on
sendBeastSettings(c, Modes.mode_ac ? "J" : "j"); // Mode A/C on or off