]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Compile with '-Wmissing-prototypes' and fix all fallout
authorAndreas Öman <andreas@lonelycoder.com>
Fri, 2 May 2008 19:37:23 +0000 (19:37 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Fri, 2 May 2008 19:37:23 +0000 (19:37 +0000)
26 files changed:
Makefile
access.c
ajaxui/ajaxui_channels.c
ajaxui/ajaxui_config_dvb.c
ajaxui/ajaxui_config_transport.c
ajaxui/ajaxui_mailbox.c
ajaxui/ajaxui_mailbox.h
autorec.c
cwc.c
dispatch.h
dvb_tables.c
epg.c
epg_xmltv.c
ffdecsa/FFdecsa.c
ffdecsa/stream.c
htsclient.c
htsclient.h
iptv_output.c
krypt.c
mux.c
pvr.c
rtsp.c
teletext.c
transports.c
tvhead.h
xbmsp.c

index 50c84d810bdd30361a0e097cb54bf9596be874b1..5d784f2de6ca55de60e1f53a494e495760fa9990 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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)
index 03fb9cb34782d1889ec164d2453e20ec0316fb5b..9199f9a8ec51036c3c6d2459c8540e03c87e0c34 100644 (file)
--- a/access.c
+++ b/access.c
@@ -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;
index bcd04e1dc1d39459a2580f6999cb881d04b65e5f..4905629edbe5d45551768d3be4155b746edd3e31 100644 (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)
 {
index b15fa74e56959bed498a2038754fee2e9e26b431..c06a398a46b5112340f9bba73c4648fbfb53c860 100644 (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];
index 519abd5ebbb5779c1ac73896bbeab7e9a32c9ad2..8f138647732099113e591e03f974f7cd00e19718 100644 (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)
 {
index 7f8ed21e21f003c0d0248865b025f559ec9d5004..3ac5eeec911d8d632641fbb600cbe1830c7c832b 100644 (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];
 
index 81654f8bfcdf2ac297c8e06a78cf6b8396aad8b2..9aa86a602b10b55b10f98d1965419c478a429fa9 100644 (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);
index 3b87b790f9933f15aa641af628c93c781c53265c..66160363dd6bba046292c5b1238eed33b2b454dc 100644 (file)
--- a/autorec.c
+++ b/autorec.c
@@ -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)
diff --git a/cwc.c b/cwc.c
index 7aebf4f7e021f969133204056f913f0c49b38ad4..3d95eb18325b2ac5773d5f76da00f8b70f1f6237 100644 (file)
--- a/cwc.c
+++ b/cwc.c
@@ -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)
 {
index 4b51c5220a61a23a9199f0c350a731248134818b..c8a02f0e5ec49ecba6d03b51d051d0822a528c83 100644 (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) {
index 09739b4bb932c1d7331b51ba9aa1c3fa1a06d6de..9db59318b26ca609b368caacc16439c2fc88a159 100644 (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;
diff --git a/epg.c b/epg.c
index 3f7d481b501846f38fb34f08606230c6c0cc818d..73dd7fd93b70249f6345e3f831437e70ee3c8b06 100644 (file)
--- a/epg.c
+++ b/epg.c
@@ -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)
index 70191942004d8ae1d0db860e629805c44e788531..ba00efb28e29ed4ae0f9d267b3e9838ad7afbaf0 100644 (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);
index ffc5147de4c50c73b4de9a75a98e7f4d2627cd8c..317f0ed3429804a39c42f2375d1184d9a6b0e8a1 100644 (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
 
index 1bda8521c588b1a4f55c6ef6ed2f9fdea3563ba5..c00482c6f7f8eb9a6caa58ac288d85c4adf79539 100644 (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
index cb8b4c118ffc45b700292bb6494aac19572cdd14..66889bc0fa6c2cf84739bc6004ef2d58ab2119cc 100644 (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");
-  }
-}
index 593950bee83ae2e9446ae124cf7054e23acf0c5b..6d5ed224a5461a86e2a6060118a7a74c40134de4 100644 (file)
@@ -23,6 +23,4 @@ void client_start(void);
 
 void clients_send_ref(int ref);
 
-void client_status_update(void);
-
 #endif /* HTSCLIENT_H_ */
index 4c1621ae7b54d17cbd6a95bf24996a188700f78b..d8342b33a094ecb05d2d707f0ae7e9cdda2de304 100644 (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)
 {
diff --git a/krypt.c b/krypt.c
index 964826eb62cf61a6dc58686ce223546773ce098a..32a19127a5d953d0ddf9e042927fbeb176d4d015 100644 (file)
--- a/krypt.c
+++ b/krypt.c
@@ -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)
 {
diff --git a/mux.c b/mux.c
index d0a3abc6d8a761be87093e49aeb2f875bb63f586..82862dc7a8f8a59375da407f0efaf696a9c48f9d 100644 (file)
--- a/mux.c
+++ b/mux.c
@@ -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;
diff --git a/pvr.c b/pvr.c
index 69233f8f6bc4486ee97447e414856a5743de1beb..d5271ce4a80be4f728acf94bb65a517fa25fa0c4 100644 (file)
--- a/pvr.c
+++ b/pvr.c
@@ -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);
 }
 
 
diff --git a/rtsp.c b/rtsp.c
index fd05c8b2bc52377e6e8d623a1905f1ed678d40a3..07aa5210d4c7db50248b540079b99c43c4dd07ea 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -41,6 +41,7 @@
 #include "tcp.h"
 #include "http.h"
 #include "access.h"
+#include "rtsp.h"
 
 #include <libavutil/random.h>
 
index d37f206a47f9b2d1373c8607ce632974701da288..35345e1762ea686221cc2b88d004249d05ee322d 100644 (file)
@@ -139,7 +139,7 @@ tt_construct_unix_time(char *buf)
 
 
 
-int
+static int
 str_is_tt_clock(const char *str)
 {
   return 
index 9b70ee8d83057c269b92eea57e2b02dcb08887f7..ad5af932f7fd7b9abcd844c5baf4b4d60c831443 100644 (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;
index a314a2d9f23adc7e31f165c20c13e70870f47e93..322bd96cd2c0e3a98d8ef0246696934bf0142668 100644 (file)
--- a/tvhead.h
+++ b/tvhead.h
@@ -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)
diff --git a/xbmsp.c b/xbmsp.c
index 60de361f6fd04407807ac179a84bffca089791bb..412e69075bfe45ec8365140e977094201f951a40 100644 (file)
--- a/xbmsp.c
+++ b/xbmsp.c
@@ -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;