summaryrefslogtreecommitdiff
authorKe Gong <ke.gong@amlogic.com>2016-09-28 05:33:35 (GMT)
committer Ke Gong <ke.gong@amlogic.com>2016-09-28 05:33:35 (GMT)
commite972ce5afc34a65d023f119f5e21ebf50da9fc4a (patch)
tree58fd64d39750ed514d2ed31faf3ce0f95229b9c3
parent866af25bfffb53a89aa0017ac0b9ef7afde722d8 (diff)
downloadlibzvbi-e972ce5afc34a65d023f119f5e21ebf50da9fc4a.zip
libzvbi-e972ce5afc34a65d023f119f5e21ebf50da9fc4a.tar.gz
libzvbi-e972ce5afc34a65d023f119f5e21ebf50da9fc4a.tar.bz2
PD#132481: fix Android 7.0 compile error
Squashed commit of the following: commit c5d53eb0a40a85273734a6d5b53ff0af5ba337e7 Author: Zhiqiang Han <zhiqiang.han@amlogic.com> Date: Tue Sep 27 10:10:27 2016 +0800 PD#132481: fix Android 7.0 compile error Change-Id: I12a6ad4e82efa7e60fef66675808ed73296554b0 Change-Id: Ia70b1f6c5f3e3d273037936400d5963b251629d3
Diffstat
-rw-r--r--[-rwxr-xr-x]Android.mk1
-rw-r--r--[-rwxr-xr-x]src/am_iconv.h1
-rw-r--r--[-rwxr-xr-x]src/exp-gfx.c2
-rw-r--r--[-rwxr-xr-x]src/misc.h4
-rw-r--r--[-rwxr-xr-x]src/packet.c34
-rw-r--r--[-rwxr-xr-x]src/teletext.c347
-rw-r--r--[-rwxr-xr-x]src/trigger.c8
7 files changed, 200 insertions, 197 deletions
diff --git a/Android.mk b/Android.mk
index 27c2545..754ec5a 100755..100644
--- a/Android.mk
+++ b/Android.mk
@@ -10,6 +10,7 @@ LOCAL_SRC_FILES := src/bit_slicer.c src/cache.c src/caption.c src/conv.c src/dvb
src/tables.c src/trigger.c src/vbi.c src/vps.c src/wss.c src/xds_demux.c src/decoder.c src/dtvcc.c
LOCAL_CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -DENABLE_DVB=1 -DENABLE_V4L=1 -DENABLE_V4L2=1 -DHAVE_ICONV=1 -DPACKAGE=\"zvbi\" -DVERSION=\"0.2.33\" -DANDROID
+LOCAL_CLANG_CFLAGS+=-Wno-error=tautological-pointer-compare
ifeq ($(ANDROID_BUILD_TYPE), 64)
LOCAL_CFLAGS+=-DHAVE_S64_U64
endif
diff --git a/src/am_iconv.h b/src/am_iconv.h
index b53dab1..1ec4e0a 100755..100644
--- a/src/am_iconv.h
+++ b/src/am_iconv.h
@@ -19,6 +19,7 @@ extern "C"
#endif
#ifdef ANDROID
+#include <malloc.h>
#include <unicode/ucnv.h>
#include <android/log.h>
diff --git a/src/exp-gfx.c b/src/exp-gfx.c
index cff298d..c8ff3d5 100755..100644
--- a/src/exp-gfx.c
+++ b/src/exp-gfx.c
@@ -303,7 +303,7 @@ draw_char(int canvas_type, uint8_t *canvas, int rowstride,
if (!(underline & 1)) {
#ifdef __GNUC__
-#if #cpu (i386)
+#if defined (i386)
bits = (*((uint16_t *) src) >> shift);
#else
/* unaligned/little endian */
diff --git a/src/misc.h b/src/misc.h
index e6cfe5f..7645d1e 100755..100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -53,10 +53,10 @@
#undef __i386__
#undef __i686__
-#if #cpu (i386)
+#if defined (i386)
# define __i386__ 1
#endif
-#if #cpu (i686)
+#if defined (i686)
# define __i686__ 1
#endif
diff --git a/src/packet.c b/src/packet.c
index 303daa0..595718c 100755..100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -1755,24 +1755,22 @@ parse_28_29(vbi_decoder *vbi, uint8_t *p,
int i, j, err = 0;
/* XXX nested function not portable, to be removed */
- int
- bits(int count)
- {
- int r, n;
-
- r = buf;
-
- if ((n = count - left) > 0) {
- r |= (buf = *triplet++) << left;
- left = 18;
- } else
- n = count;
-
- buf >>= n;
- left -= n;
-
- return r & ((1UL << count) - 1);
- }
+#define bits(count) ({ \
+ int r, n; \
+ \
+ r = buf; \
+ \
+ if ((n = count - left) > 0) { \
+ r |= (buf = *triplet++) << left; \
+ left = 18; \
+ } else \
+ n = count; \
+ \
+ buf >>= n; \
+ left -= n; \
+ \
+ r & ((1UL << count) - 1);\
+ })
if ((designation = vbi_unham8 (*p)) < 0)
return FALSE;
diff --git a/src/teletext.c b/src/teletext.c
index 55c631d..837b4bf 100755..100644
--- a/src/teletext.c
+++ b/src/teletext.c
@@ -1258,180 +1258,177 @@ enhance(vbi_decoder *vbi,
int pdc_hr;
/* XXX nested function not portable, to be removed */
- void
- flush(int column)
- {
- int row = inv_row + active_row;
- int i;
-
- if (row >= ROWS)
- return;
-
- if (type == OBJECT_TYPE_PASSIVE && !mac.unicode) {
- active_column = column;
- return;
- }
-
- printv("flush [%04x%c,F%d%c,B%d%c,S%d%c,O%d%c,H%d%c] %d ... %d\n",
- ac.unicode, mac.unicode ? '*' : ' ',
- ac.foreground, mac.foreground ? '*' : ' ',
- ac.background, mac.background ? '*' : ' ',
- ac.size, mac.size ? '*' : ' ',
- ac.opacity, mac.opacity ? '*' : ' ',
- ac.flash, mac.flash ? '*' : ' ',
- active_column, column - 1);
-
- for (i = inv_column + active_column; i < inv_column + column;) {
- vbi_char c;
-
- if (i > 39)
- break;
-
- c = acp[i];
-
- if (mac.underline) {
- int u = ac.underline;
-
- if (!mac.unicode)
- ac.unicode = c.unicode;
-
- if (vbi_is_gfx(ac.unicode)) {
- if (u)
- ac.unicode &= ~0x20; /* separated */
- else
- ac.unicode |= 0x20; /* contiguous */
- mac.unicode = ~0;
- u = 0;
- }
-
- c.underline = u;
- }
- if (mac.foreground)
- c.foreground = (ac.foreground != VBI_TRANSPARENT_BLACK) ?
- ac.foreground : (row_color_transparent) ?
- VBI_TRANSPARENT_BLACK : row_color;
- if (mac.background)
- c.background = (ac.background != VBI_TRANSPARENT_BLACK) ?
- ac.background : (row_color_transparent) ?
- VBI_TRANSPARENT_BLACK : row_color;
- if (invert) {
- int t = c.foreground;
-
- c.foreground = c.background;
- c.background = t;
- }
- if (mac.opacity)
- c.opacity = ac.opacity;
- if (mac.flash)
- c.flash = ac.flash;
- if (mac.conceal)
- c.conceal = ac.conceal;
- if (mac.unicode) {
- c.unicode = ac.unicode;
- mac.unicode = 0;
-
- if (mac.size)
- c.size = ac.size;
- else if (c.size > VBI_DOUBLE_SIZE)
- c.size = VBI_NORMAL_SIZE;
- }
-
- acp[i] = c;
-
- if (type == OBJECT_TYPE_PASSIVE)
- break;
-
- i++;
-
- if (type != OBJECT_TYPE_PASSIVE
- && type != OBJECT_TYPE_ADAPTIVE) {
- int raw;
-
- raw = (row == 0 && i < 9) ?
- 0x20 : vbi_unpar8 (vtp->data.lop.raw[row][i - 1]);
-
- /* set-after spacing attributes cancelling non-spacing */
-
- switch (raw) {
- case 0x00 ... 0x07: /* alpha + foreground color */
- case 0x10 ... 0x17: /* mosaic + foreground color */
- printv("... fg term %d %02x\n", i, raw);
- mac.foreground = 0;
- mac.conceal = 0;
- break;
-
- case 0x08: /* flash */
- mac.flash = 0;
- break;
-
- case 0x0A: /* end box */
- case 0x0B: /* start box */
- if (i < COLUMNS && vbi_unpar8 (vtp->data.lop.raw[row][i]) == raw) {
- printv("... boxed term %d %02x\n", i, raw);
- mac.opacity = 0;
- }
-
- break;
-
- case 0x0D: /* double height */
- case 0x0E: /* double width */
- case 0x0F: /* double size */
- printv("... size term %d %02x\n", i, raw);
- mac.size = 0;
- break;
- }
-
- if (i > 39)
- break;
-
- raw = (row == 0 && i < 8) ?
- 0x20 : vbi_unpar8 (vtp->data.lop.raw[row][i]);
-
- /* set-at spacing attributes cancelling non-spacing */
-
- switch (raw) {
- case 0x09: /* steady */
- mac.flash = 0;
- break;
-
- case 0x0C: /* normal size */
- printv("... size term %d %02x\n", i, raw);
- mac.size = 0;
- break;
-
- case 0x18: /* conceal */
- mac.conceal = 0;
- break;
-
- /*
- * Non-spacing underlined/separated display attribute
- * cannot be cancelled by a subsequent spacing attribute.
- */
-
- case 0x1C: /* black background */
- case 0x1D: /* new background */
- printv("... bg term %d %02x\n", i, raw);
- mac.background = 0;
- break;
- }
- }
- }
-
- active_column = column;
- }
+#define flush(column) \
+ ({ \
+ int row = inv_row + active_row; \
+ int i; \
+ \
+ if (row >= ROWS) \
+ break; \
+ \
+ if (type == OBJECT_TYPE_PASSIVE && !mac.unicode) { \
+ active_column = column; \
+ break; \
+ } \
+ \
+ printv("flush [%04x%c,F%d%c,B%d%c,S%d%c,O%d%c,H%d%c] %d ... %d\n", \
+ ac.unicode, mac.unicode ? '*' : ' ', \
+ ac.foreground, mac.foreground ? '*' : ' ', \
+ ac.background, mac.background ? '*' : ' ', \
+ ac.size, mac.size ? '*' : ' ', \
+ ac.opacity, mac.opacity ? '*' : ' ', \
+ ac.flash, mac.flash ? '*' : ' ', \
+ active_column, column - 1); \
+ \
+ for (i = inv_column + active_column; i < inv_column + column;) { \
+ vbi_char c; \
+ \
+ if (i > 39) \
+ break; \
+ \
+ c = acp[i]; \
+ \
+ if (mac.underline) { \
+ int u = ac.underline; \
+ \
+ if (!mac.unicode) \
+ ac.unicode = c.unicode; \
+ \
+ if (vbi_is_gfx(ac.unicode)) { \
+ if (u) \
+ ac.unicode &= ~0x20; /* separated */ \
+ else \
+ ac.unicode |= 0x20; /* contiguous */ \
+ mac.unicode = ~0; \
+ u = 0; \
+ } \
+ \
+ c.underline = u; \
+ } \
+ if (mac.foreground) \
+ c.foreground = (ac.foreground != VBI_TRANSPARENT_BLACK) ? \
+ ac.foreground : (row_color_transparent) ? \
+ VBI_TRANSPARENT_BLACK : row_color; \
+ if (mac.background) \
+ c.background = (ac.background != VBI_TRANSPARENT_BLACK) ? \
+ ac.background : (row_color_transparent) ? \
+ VBI_TRANSPARENT_BLACK : row_color; \
+ if (invert) { \
+ int t = c.foreground; \
+ \
+ c.foreground = c.background; \
+ c.background = t; \
+ } \
+ if (mac.opacity) \
+ c.opacity = ac.opacity; \
+ if (mac.flash) \
+ c.flash = ac.flash; \
+ if (mac.conceal) \
+ c.conceal = ac.conceal; \
+ if (mac.unicode) { \
+ c.unicode = ac.unicode; \
+ mac.unicode = 0; \
+ \
+ if (mac.size) \
+ c.size = ac.size; \
+ else if (c.size > VBI_DOUBLE_SIZE) \
+ c.size = VBI_NORMAL_SIZE; \
+ } \
+ \
+ acp[i] = c; \
+ \
+ if (type == OBJECT_TYPE_PASSIVE) \
+ break; \
+ \
+ i++; \
+ \
+ if (type != OBJECT_TYPE_PASSIVE \
+ && type != OBJECT_TYPE_ADAPTIVE) { \
+ int raw; \
+ \
+ raw = (row == 0 && i < 9) ? \
+ 0x20 : vbi_unpar8 (vtp->data.lop.raw[row][i - 1]); \
+ \
+ /* set-after spacing attributes cancelling non-spacing */ \
+ \
+ switch (raw) { \
+ case 0x00 ... 0x07: /* alpha + foreground color */ \
+ case 0x10 ... 0x17: /* mosaic + foreground color */ \
+ printv("... fg term %d %02x\n", i, raw); \
+ mac.foreground = 0; \
+ mac.conceal = 0; \
+ break; \
+ \
+ case 0x08: /* flash */ \
+ mac.flash = 0; \
+ break; \
+ \
+ case 0x0A: /* end box */ \
+ case 0x0B: /* start box */ \
+ if (i < COLUMNS && vbi_unpar8 (vtp->data.lop.raw[row][i]) == raw) { \
+ printv("... boxed term %d %02x\n", i, raw); \
+ mac.opacity = 0; \
+ } \
+ \
+ break; \
+ \
+ case 0x0D: /* double height */ \
+ case 0x0E: /* double width */ \
+ case 0x0F: /* double size */ \
+ printv("... size term %d %02x\n", i, raw); \
+ mac.size = 0; \
+ break; \
+ } \
+ \
+ if (i > 39) \
+ break; \
+ \
+ raw = (row == 0 && i < 8) ? \
+ 0x20 : vbi_unpar8 (vtp->data.lop.raw[row][i]); \
+ \
+ /* set-at spacing attributes cancelling non-spacing */ \
+ \
+ switch (raw) { \
+ case 0x09: /* steady */ \
+ mac.flash = 0; \
+ break; \
+ \
+ case 0x0C: /* normal size */ \
+ printv("... size term %d %02x\n", i, raw); \
+ mac.size = 0; \
+ break; \
+ \
+ case 0x18: /* conceal */ \
+ mac.conceal = 0; \
+ break; \
+ \
+ /* \
+ * Non-spacing underlined/separated display attribute \
+ * cannot be cancelled by a subsequent spacing attribute. \
+ */ \
+ \
+ case 0x1C: /* black background */ \
+ case 0x1D: /* new background */ \
+ printv("... bg term %d %02x\n", i, raw); \
+ mac.background = 0; \
+ break; \
+ } \
+ } \
+ } \
+ \
+ active_column = column; \
+ })
/* XXX nested function not portable, to be removed */
- void
- flush_row(void)
- {
- if (type == OBJECT_TYPE_PASSIVE || type == OBJECT_TYPE_ADAPTIVE)
- flush(active_column + 1);
- else
- flush(COLUMNS);
-
- if (type != OBJECT_TYPE_PASSIVE)
- memset(&mac, 0, sizeof(mac));
- }
+#define flush_row() do {\
+ if (type == OBJECT_TYPE_PASSIVE || type == OBJECT_TYPE_ADAPTIVE) \
+ flush(active_column + 1); \
+ else \
+ flush(COLUMNS); \
+\
+ if (type != OBJECT_TYPE_PASSIVE) \
+ memset(&mac, 0, sizeof(mac)); \
+ } while (0)
active_column = 0;
active_row = 0;
@@ -2873,7 +2870,11 @@ vbi_fetch_vt_page(vbi_decoder *vbi, vbi_page *pg,
return success;
}
}
-
+extern cache_page *
+_vbi_cache_find_next_page_2 (vbi_cache * ca,
+ int dir,
+ vbi_subno pgno,
+ vbi_subno subno);
vbi_bool
vbi_get_next_pgno(vbi_decoder *vbi, int dir, vbi_pgno *pgno, vbi_pgno *subno)
{
diff --git a/src/trigger.c b/src/trigger.c
index 5988d62..dc242be 100755..100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -336,8 +336,10 @@ parse_eacem(vbi_trigger *t, char *s1, unsigned int nuid, double now)
t->link.expires = t->fire + active / 25.0;
/* EACEM eqv PAL/SECAM land, 25 fps */
+ /*
if (!t->link.url)
return NULL;
+ */
if (strncmp((char *) t->link.url, "http://", 7) == 0)
t->link.type = VBI_LINK_HTTP;
@@ -347,7 +349,7 @@ parse_eacem(vbi_trigger *t, char *s1, unsigned int nuid, double now)
t->link.type = VBI_LINK_TELEWEB;
else if (strncmp((char *) t->link.url, "dummy", 5) == 0) {
t->link.pgno = parse_dec((char *) t->link.url + 5, 2);
- if (!t->link.name || t->link.pgno < 0 || t->link.url[7])
+ if (/*!t->link.name || */t->link.pgno < 0 || t->link.url[7])
return NULL;
t->link.type = VBI_LINK_MESSAGE;
} else if (strncmp((char *) t->link.url, "ttx://", 6) == 0) {
@@ -546,10 +548,10 @@ parse_atvef(vbi_trigger *t, char *s1, double now)
else
return NULL;
}
-
+ /*
if (!t->link.url)
return NULL;
-
+ */
if (strncmp((char *) t->link.url, "http://", 7) == 0)
t->link.type = VBI_LINK_HTTP;
else if (strncmp((char *) t->link.url, "lid://", 6) == 0)