Compile with '-Wmissing-prototypes' and fix all fallout

This commit is contained in:
Andreas Öman 2008-05-02 19:37:23 +00:00
parent faec46b963
commit b8a93bef06
26 changed files with 43 additions and 146 deletions

View file

@ -66,7 +66,7 @@ PROG = tvheadend
MAN = tvheadend.1
CFLAGS += -g -Wall -Werror -O2 -mmmx
CFLAGS += -I$(INCLUDES_INSTALL_BASE) $(HTS_CFLAGS) -I$(CURDIR)
CFLAGS += -Wno-deprecated-declarations
CFLAGS += -Wno-deprecated-declarations -Wmissing-prototypes
CFLAGS += -D_LARGEFILE64_SOURCE
CFLAGS += -DENABLE_INPUT_IPTV -DENABLE_INPUT_DVB -DENABLE_INPUT_V4L
LDFLAGS += -L$(LIBS_INSTALL_BASE)

View file

@ -66,7 +66,7 @@ access_alloc(void)
/**
*
*/
access_entry_t *
static access_entry_t *
access_add_network(const char *prefix)
{
access_entry_t *ae;
@ -112,7 +112,7 @@ access_add_network(const char *prefix)
/**
*
*/
access_entry_t *
static access_entry_t *
access_add_user(const char *username)
{
access_entry_t *ae;

View file

@ -127,7 +127,7 @@ ajax_list_events(tcp_queue_t *tq, th_channel_t *ch, int lines)
*
* Group is given by 'tag' as an ASCII string in remain
*/
int
static int
ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{

View file

@ -51,7 +51,7 @@ add_option(tcp_queue_t *tq, int bol, const char *name)
/**
*
*/
const char *
static const char *
nicenum(unsigned int v)
{
static char buf[4][30];

View file

@ -307,7 +307,7 @@ dvb_unmap_channel(th_transport_t *t, tcp_queue_t *tq)
/**
*
*/
int
static int
ajax_transport_op(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{
@ -351,7 +351,7 @@ ajax_transport_op(http_connection_t *hc, http_reply_t *hr,
/**
*
*/
int
static int
ajax_transport_chdisable(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{

View file

@ -32,6 +32,7 @@
#include "transports.h"
#include "epg_xmltv.h"
#include "dvb_support.h"
#include "ajaxui_mailbox.h"
#define MAILBOX_UNUSED_TIMEOUT 15
#define MAILBOX_EMPTY_REPLY_TIMEOUT 10
@ -454,7 +455,7 @@ ajax_mailbox_tda_change(th_dvb_adapter_t *tda)
void
ajax_mailbox_xmltv_grabber_status_change(xmltv_grabber_t *xg, int status)
ajax_mailbox_xmltv_grabber_status_change(xmltv_grabber_t *xg)
{
char buf[500];

View file

@ -21,8 +21,6 @@
#include "tcp.h"
int ajax_mailbox_create(const char *subscriptionid);
void ajax_mailbox_tdmi_state_change(th_dvb_mux_instance_t *tdmi);
void ajax_mailbox_tdmi_qual_change(th_dvb_mux_instance_t *tdmi);

View file

@ -57,7 +57,7 @@ autorec_init(void)
/**
* return 1 if the event 'e' is matched by the autorec rule 'ar'
*/
int
static int
autorec_cmp(autorec_t *ar, event_t *e)
{
if(ar->ar_ch != NULL && ar->ar_ch != e->e_ch)

4
cwc.c
View file

@ -18,6 +18,7 @@
#include <pthread.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -35,6 +36,7 @@
#include "ffdecsa/FFdecsa.h"
#include "dispatch.h"
#include "transports.h"
#include "cwc.h"
#define CWC_KEEPALIVE_INTERVAL 600
@ -639,7 +641,7 @@ cwc_tcp_callback(tcpevent_t event, void *tcpsession)
/**
*
*/
void
static void
cwc_table_input(struct th_descrambler *td, struct th_transport *t,
struct th_stream *st, uint8_t *data, int len)
{

View file

@ -29,7 +29,7 @@ extern time_t dispatch_clock;
#define DISPATCH_ERR 0x4
#define DISPATCH_PRI 0x8
extern inline int64_t
static inline int64_t
getclock_hires(void)
{
int64_t now;
@ -54,7 +54,7 @@ void dtimer_arm_hires(dtimer_t *ti, dti_callback_t *callback,
void *aux, int64_t t);
extern inline void
static inline void
dtimer_disarm(dtimer_t *ti)
{
if(ti->dti_callback) {

View file

@ -731,7 +731,7 @@ dvb_rst_callback(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
/**
* Helper for preparing a section filter parameter struct
*/
struct dmx_sct_filter_params *
static struct dmx_sct_filter_params *
dvb_fparams_alloc(int pid, int flags)
{
struct dmx_sct_filter_params *p;

4
epg.c
View file

@ -53,7 +53,7 @@ epg_event_set_desc(event_t *e, const char *desc)
e->e_desc = strdup(desc);
}
void
static void
epg_event_set_content_type(event_t *e, epg_content_type_t *ect)
{
if(e->e_content_type != NULL)
@ -378,8 +378,6 @@ epg_set_current_event(th_channel_t *ch, event_t *e)
/* Notify clients that a new programme is on */
clients_send_ref(ch->ch_tag);
htsp_async_channel_update(ch);
if(e == NULL)

View file

@ -38,7 +38,6 @@
#include "channels.h"
#include "epg.h"
#include "epg_xmltv.h"
#include "refstr.h"
#include "spawn.h"
#include "intercom.h"
#include "notify.h"
@ -528,7 +527,7 @@ xmltv_thread(void *aux)
/**
*
*/
void
static void
xmltv_grabber_enqueue(xmltv_grabber_t *xg)
{
pthread_mutex_lock(&xmltv_work_lock);

View file

@ -537,11 +537,12 @@ void set_odd_control_word(void *keys, const unsigned char *pk){
}
//-----get control words
#if 0
void get_control_words(void *keys, unsigned char *even, unsigned char *odd){
memcpy(even,&((struct csa_keys_t *)keys)->even.ck,8);
memcpy(odd,&((struct csa_keys_t *)keys)->odd.ck,8);
}
#endif
//----- decrypt

View file

@ -436,14 +436,14 @@ static inline void trasp64_128_88cw(unsigned char *data){
#ifdef STREAM_INIT
void stream_cypher_group_init(
static void stream_cypher_group_init(
struct stream_regs *regs,
group iA[8][4], // [In] iA00,iA01,...iA73 32 groups | Derived from key.
group iB[8][4], // [In] iB00,iB01,...iB73 32 groups | Derived from key.
unsigned char *sb) // [In] (SB0,SB1,...SB7)...x32 32*8 bytes | Extra input.
#endif
#ifdef STREAM_NORMAL
void stream_cypher_group_normal(
static void stream_cypher_group_normal(
struct stream_regs *regs,
unsigned char *cb) // [Out] (CB0,CB1,...CB7)...x32 32*8 bytes | Output.
#endif

View file

@ -40,6 +40,7 @@
#include "buffer.h"
#include "tsmux.h"
#include "tcp.h"
#include "htsclient.h"
LIST_HEAD(client_list, client);
@ -72,12 +73,12 @@ typedef struct client {
static void client_status_update(void *aux, int64_t now);
void client_status_update(void *aux, int64_t now);
#define cprintf(c, fmt...) tcp_printf(&(c)->c_tcp_session, fmt)
void
static void
client_output_ts(void *opaque, th_subscription_t *s,
uint8_t *pkt, int blocks, int64_t pcr)
{
@ -114,36 +115,6 @@ client_output_ts(void *opaque, th_subscription_t *s,
}
/*
*
*
*/
void
clients_send_ref(int ref)
{
client_t *c;
char buf[10];
uint32_t v = htonl(ref);
struct sockaddr_in sin;
buf[0] = HTSTV_REFTAG;
memcpy(buf + 1, &v, sizeof(uint32_t));
LIST_FOREACH(c, &all_clients, c_global_link) {
if(c->c_streamfd == -1)
continue;
sin.sin_family = AF_INET;
sin.sin_port = htons(c->c_port);
sin.sin_addr = c->c_ipaddr;
sendto(c->c_streamfd, buf, 5, 0,
(struct sockaddr *)&sin, sizeof(sin));
}
}
/*
*
*/
@ -175,7 +146,7 @@ cr_channel_info(client_t *c, char **argv, int argc)
*
*/
int
static int
cr_channel_unsubscribe(client_t *c, char **argv, int argc)
{
th_subscription_t *s;
@ -228,7 +199,7 @@ client_subscription_callback(struct th_subscription *s,
/*
*
*/
int
static int
cr_channel_subscribe(client_t *c, char **argv, int argc)
{
th_channel_t *ch;
@ -272,7 +243,7 @@ cr_channel_subscribe(client_t *c, char **argv, int argc)
*
*/
int
static int
cr_channels_list(client_t *c, char **argv, int argc)
{
th_channel_t *ch;
@ -290,7 +261,7 @@ cr_channels_list(client_t *c, char **argv, int argc)
*
*/
int
static int
cr_streamport(client_t *c, char **argv, int argc)
{
if(argc < 2)
@ -579,7 +550,6 @@ htsclient_tcp_callback(tcpevent_t event, void *tcpsession)
TAILQ_INIT(&c->c_refq);
LIST_INSERT_HEAD(&all_clients, c, c_global_link);
c->c_streamfd = -1;
dtimer_arm(&c->c_status_timer, client_status_update, c, 1);
break;
case TCP_DISCONNECT:
@ -604,67 +574,3 @@ client_start(void)
htsclient_tcp_callback);
}
/*
* Periodically send status updates to client (on stream 2)
*/
static void
csprintf(client_t *c, th_channel_t *ch, const char *fmt, ...)
{
va_list ap;
char buf[1000];
struct sockaddr_in sin;
memset(&sin, 0, sizeof(sin));
buf[0] = HTSTV_STATUS;
buf[1] = ch->ch_index;
va_start(ap, fmt);
vsnprintf(buf + 2, sizeof(buf) - 2, fmt, ap);
va_end(ap);
sin.sin_family = AF_INET;
sin.sin_port = htons(c->c_port);
sin.sin_addr = c->c_ipaddr;
sendto(c->c_streamfd, buf, strlen(buf + 2) + 2, 0,
(struct sockaddr *)&sin, sizeof(sin));
}
static void
client_status_update(void *aux, int64_t now)
{
client_t *c = aux;
th_channel_t *ch;
th_subscription_t *s;
th_transport_t *t;
dtimer_arm(&c->c_status_timer, client_status_update, c, 1);
LIST_FOREACH(s, &c->c_subscriptions, ths_subscriber_link) {
ch = s->ths_channel;
t = s->ths_transport;
if(t == NULL) {
csprintf(c, ch,
"status = 0\n"
"info = No transport available");
continue;
}
csprintf(c, ch,
"status = 0\n"
"info = Running");
}
}

View file

@ -23,6 +23,4 @@ void client_start(void);
void clients_send_ref(int ref);
void client_status_update(void);
#endif /* HTSCLIENT_H_ */

View file

@ -60,7 +60,7 @@ typedef struct output_multicast {
/**
* Output MPEG TS
*/
void
static void
iptv_output_ts(void *opaque, th_subscription_t *s, uint8_t *pkt,
int blocks, int64_t pcr)
{

View file

@ -1,6 +1,8 @@
#define _XOPEN_SOURCE
#include <unistd.h>
char *cwc_krypt(const char *key, const char *salt);
char *
cwc_krypt(const char *key, const char *salt)
{

5
mux.c
View file

@ -41,7 +41,7 @@
#include "subscriptions.h"
#include "psi.h"
#include "buffer.h"
#include "mux.h"
@ -132,8 +132,7 @@ mux_new_packet(th_muxer_t *tm, th_stream_t *st, th_pkt_t *pkt)
* TS Muxer
*/
th_muxer_t *
muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque,
int flags)
muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque)
{
th_transport_t *t = s->ths_transport;
th_stream_t *st;

5
pvr.c
View file

@ -133,12 +133,9 @@ pvr_inform_status_change(pvr_rec_t *pvrr)
{
event_t *e;
clients_send_ref(pvrr->pvrr_ref);
e = epg_event_find_by_time(pvrr->pvrr_channel, pvrr->pvrr_start);
if(e != NULL)
clients_send_ref(e->e_tag);
}
@ -175,7 +172,6 @@ pvr_abort(pvr_rec_t *pvrr)
pvr_fsm(pvrr);
pvr_database_save(pvrr);
clients_send_ref(-1);
return 0;
}
@ -223,7 +219,6 @@ pvr_link_pvrr(pvr_rec_t *pvrr)
}
pvr_inform_status_change(pvrr);
clients_send_ref(-1);
}

1
rtsp.c
View file

@ -41,6 +41,7 @@
#include "tcp.h"
#include "http.h"
#include "access.h"
#include "rtsp.h"
#include <libavutil/random.h>

View file

@ -139,7 +139,7 @@ tt_construct_unix_time(char *buf)
int
static int
str_is_tt_clock(const char *str)
{
return

View file

@ -326,7 +326,7 @@ transport_find(th_channel_t *ch, unsigned int weight)
*
*/
void
static void
transport_flush_subscribers(th_transport_t *t)
{
th_subscription_t *s;

View file

@ -27,7 +27,6 @@
#include <libhts/htscfg.h>
#include <libhts/avg.h>
#include <libhts/hts_strtab.h>
#include "refstr.h"
#include <libavcodec/avcodec.h>
/*
@ -894,8 +893,6 @@ typedef struct event {
#define EVENT_SRC_XMLTV 1
#define EVENT_SRC_DVB 2
refstr_t *e_icon;
} event_t;
config_entry_t *find_mux_config(const char *muxtype, const char *muxname);
@ -909,7 +906,7 @@ FILE *settings_open_for_read(const char *name);
extern const char *sys_warning;
extern th_channel_group_t *defgroup;
extern inline unsigned int tvh_strhash(const char *s, unsigned int mod)
static inline unsigned int tvh_strhash(const char *s, unsigned int mod)
{
unsigned int v = 5381;
while(*s)

10
xbmsp.c
View file

@ -48,7 +48,7 @@ extern AVOutputFormat mpegts_muxer;
* Function for delivery of data.
* We try to respond to any pending read
*/
void
static void
xbmsp_output_file(void *opaque)
{
xbmsp_subscrption_t *xs = opaque;
@ -218,7 +218,7 @@ xbmsp_dir_add_entry(xbmsp_dirhandle_t *xdh, const char *name,
/**
*
*/
th_channel_group_t *
static th_channel_group_t *
xbmsp_cur_channel_group(xbmsp_t *xbmsp)
{
th_channel_group_t *tcg;
@ -314,7 +314,7 @@ xbmsp_close_dirhandle(xbmsp_t *xbmsp, uint32_t handle)
/**
* xbmsp_cdup() - Change to one directory up (cd ..)
*/
const char *
static const char *
xbmsp_cdup(xbmsp_t *xbmsp)
{
char *wd = xbmsp->xbmsp_wd;
@ -332,7 +332,7 @@ xbmsp_cdup(xbmsp_t *xbmsp)
/**
* xbmsp_cdroot() - Change to root (cd /)
*/
const char *
static const char *
xbmsp_cdroot(xbmsp_t *xbmsp)
{
free(xbmsp->xbmsp_wd);
@ -343,7 +343,7 @@ xbmsp_cdroot(xbmsp_t *xbmsp)
/**
* xbmsp_cddown() - Change to root (cd dir)
*/
const char *
static const char *
xbmsp_cddown(xbmsp_t *xbmsp, const char *dir)
{
th_channel_group_t *tcg;