[mythtv] Failing compiling dvb support (and a little error patch)

Ben Bucksch linux.news at bucksch.org
Sat May 17 23:21:25 EDT 2003


Isaac Richards wrote:

>Fixed with what I just checked in, perhaps?
>
nope :-(. dvbdev.c:167: parse error before `struct'. Very helpful.

AAAHHHHHRG!!!!
*sigh*
In C, variable definitions may only appear at the beginning of a block, 
not in the middle of statements like in C++. Moving the definition to 
the top of the function fixes it.

Fix attached, should also fix a bug for OLDSTRUCT (not used atm), and an 
error check (this *is* needed).

Ben
-------------- next part --------------
Index: dvbdev.c
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libdvbdev/dvbdev.c,v
retrieving revision 1.2
diff -u -r1.2 dvbdev.c
--- dvbdev.c	17 May 2003 17:06:17 -0000	1.2
+++ dvbdev.c	17 May 2003 20:18:52 -0000
@@ -63,6 +63,9 @@
 char* demuxdev[4]={"/dev/ost/demux0","/dev/ost/demux1","/dev/ost/demux2","/dev/ost/demux3"};
 #endif
 
+  if (cardnum > 3)
+    return "no such device number";
+
   switch(type)
   {
     case dvbdev_frontend:
@@ -70,7 +73,11 @@
     case dvbdev_dvr:
       return dvrdev[cardnum];
     case dvbdev_sec:
+#ifdef NEWSTRUCT
       return "not valid in newstruct";
+#else
+      return secdev[cardnum];
+#endif
     case dvbdev_demux:
       return demuxdev[cardnum];
   }
@@ -154,6 +161,7 @@
   uint8_t off = 0;
   ipack *p = 0;
   int i;
+  struct append_buffer app_buf;
 
   if (!(buf[3] & 0x10)) // no payload?
     return;
@@ -164,7 +172,6 @@
   if (p == 0)
     return;
 
-  struct append_buffer app_buf;
   app_buf.memory = out_buf;
   app_buf.buf_len = out_buf_max_len;
   app_buf.content_len = 0;


More information about the mythtv-dev mailing list