aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-04-01 09:24:40 (GMT)
committerGerd Hoffmann <kraxel@redhat.com>2010-04-01 09:24:40 (GMT)
commit9bbee7df3b13eb0caf1874748038235350916fbd (patch)
tree3fb2783458e405e75e9e0b2fc4e26f38ee601f0d /common
parent82fbaff22e3e4b1bbdd1e2192cfeff061ce7285c (diff)
v3.84
Diffstat (limited to 'common')
-rw-r--r--common/channel.c12
-rw-r--r--common/commands.c7
-rw-r--r--common/commands.h2
-rw-r--r--common/frequencies.h4
-rw-r--r--common/joystick.c2
-rw-r--r--common/list.h169
-rw-r--r--common/vbi-sim.c2
7 files changed, 17 insertions, 181 deletions
diff --git a/common/channel.c b/common/channel.c
index 567f6ae..b10802f 100644
--- a/common/channel.c
+++ b/common/channel.c
@@ -388,6 +388,7 @@ init_channel(char *name, struct CHANNEL *c)
void
read_config(char *conffile, int *argc, char **argv)
{
+ struct list_head *item;
char filename[100];
char *val;
int i;
@@ -489,10 +490,13 @@ read_config(char *conffile, int *argc, char **argv)
if (NULL != (val = cfg_get_str("global","mov-rate")))
mov_rate = val;
- if (NULL != (val = cfg_get_str("global","filter")))
- for (i = 0; NULL != ng_filters[i]; i++)
- if (0 == strcasecmp(ng_filters[i]->name, val))
- cur_filter=ng_filters[i];
+ if (NULL != (val = cfg_get_str("global","filter"))) {
+ list_for_each(item,&ng_filters) {
+ struct ng_filter *f = list_entry(item, struct ng_filter, list);
+ if (0 == strcasecmp(f->name, val))
+ cur_filter = f;
+ }
+ }
}
void
diff --git a/common/commands.c b/common/commands.c
index aa13501..429aef4 100644
--- a/common/commands.c
+++ b/common/commands.c
@@ -67,7 +67,7 @@ int do_overlay;
char *snapbase = "snap";
int have_shmem;
-int cur_tv_width,cur_tv_height;
+unsigned int cur_tv_width,cur_tv_height;
int cur_movie,cur_attrs[256];
/* current hardware driver */
@@ -955,7 +955,7 @@ static int list_handler(char *name, int argc, char **argv)
static int dattr_handler(char *name, int argc, char **argv)
{
struct ng_attribute *attr = NULL;
- int i;
+ unsigned int i;
if (argc > 0 && 0 == strcasecmp(argv[0],"next")) {
for (i = 0; i < NUM_DATTR; i++) {
@@ -1269,7 +1269,8 @@ vdr_handler(char *name, int argc, char **argv)
{
char line[80];
struct addrinfo ask;
- int i,l,len;
+ int i;
+ unsigned int l,len;
if (-1 == vdr_sock) {
memset(&ask,0,sizeof(ask));
diff --git a/common/commands.h b/common/commands.h
index f3ac2b4..8e51e9d 100644
--- a/common/commands.h
+++ b/common/commands.h
@@ -52,7 +52,7 @@ extern int debug;
extern int do_overlay;
extern char *snapbase;
extern int have_shmem;
-extern int cur_tv_width,cur_tv_height;
+extern unsigned int cur_tv_width,cur_tv_height;
extern int cur_movie,cur_attrs[256];
extern struct movie_parm m_parm;
diff --git a/common/frequencies.h b/common/frequencies.h
index 47cd7b7..113e96c 100644
--- a/common/frequencies.h
+++ b/common/frequencies.h
@@ -80,8 +80,8 @@
/* --------------------------------------------------------------------- */
struct CHANLIST {
- char *name;
- int freq;
+ char *name;
+ unsigned int freq;
};
struct CHANLISTS {
diff --git a/common/joystick.c b/common/joystick.c
index 3498bf0..da64a3e 100644
--- a/common/joystick.c
+++ b/common/joystick.c
@@ -90,7 +90,7 @@ int joystick_tv_init(char *dev)
void joystick_tv_havedata(int js)
{
#ifdef HAVE_LINUX_JOYSTICK_H
- int i;
+ unsigned int i;
struct js_event event;
if (debug)
fprintf(stderr, "joystick: received input\n");
diff --git a/common/list.h b/common/list.h
deleted file mode 100644
index 902f7d4..0000000
--- a/common/list.h
+++ /dev/null
@@ -1,169 +0,0 @@
-#ifndef _LIST_H
-#define _LIST_H 1
-
-/*
- * Simple doubly linked list implementation.
- * -- shameless stolen from the linux kernel sources
- *
- * Some of the internal functions ("__xxx") are useful when
- * manipulating whole lists rather than single entries, as
- * sometimes we already know the next/prev entries and we can
- * generate better code by using them directly rather than
- * using the generic single-entry routines.
- */
-
-struct list_head {
- struct list_head *next, *prev;
-};
-
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
-#define INIT_LIST_HEAD(ptr) do { \
- (ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
-
-/*
- * Insert a new entry between two known consecutive entries.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static __inline__ void __list_add(struct list_head * new,
- struct list_head * prev,
- struct list_head * next)
-{
- next->prev = new;
- new->next = next;
- new->prev = prev;
- prev->next = new;
-}
-
-/**
- * list_add - add a new entry
- * @new: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-static __inline__ void list_add(struct list_head *new, struct list_head *head)
-{
- __list_add(new, head, head->next);
-}
-
-/**
- * list_add_tail - add a new entry
- * @new: new entry to be added
- * @head: list head to add it before
- *
- * Insert a new entry before the specified head.
- * This is useful for implementing queues.
- */
-static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
-{
- __list_add(new, head->prev, head);
-}
-
-/*
- * Delete a list entry by making the prev/next entries
- * point to each other.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static __inline__ void __list_del(struct list_head * prev,
- struct list_head * next)
-{
- next->prev = prev;
- prev->next = next;
-}
-
-/**
- * list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
- */
-static __inline__ void list_del(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
-}
-
-/**
- * list_del_init - deletes entry from list and reinitialize it.
- * @entry: the element to delete from the list.
- */
-static __inline__ void list_del_init(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
-}
-
-/**
- * list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static __inline__ int list_empty(struct list_head *head)
-{
- return head->next == head;
-}
-
-/**
- * list_splice - join two lists
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- */
-static __inline__ void list_splice(struct list_head *list, struct list_head *head)
-{
- struct list_head *first = list->next;
-
- if (first != list) {
- struct list_head *last = list->prev;
- struct list_head *at = head->next;
-
- first->prev = head;
- head->next = first;
-
- last->next = at;
- at->prev = last;
- }
-}
-
-/**
- * list_entry - get the struct for this entry
- * @ptr: the &struct list_head pointer.
- * @type: the type of the struct this is embedded in.
- * @member: the name of the list_struct within the struct.
- */
-#define list_entry(ptr, type, member) \
- ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
-
-/**
- * list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- */
-#define list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the &struct list_head to use as a loop counter.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- */
-#define list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
-
-/**
- * list_for_each_prev - iterate over a list in reverse order
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- */
-#define list_for_each_prev(pos, head) \
- for (pos = (head)->prev; pos != (head); pos = pos->prev)
-
-#endif /* _LIST_H */
diff --git a/common/vbi-sim.c b/common/vbi-sim.c
index 88c7e45..e9fca68 100644
--- a/common/vbi-sim.c
+++ b/common/vbi-sim.c
@@ -197,7 +197,7 @@ ttx_sim(double t, double F, const uint8_t *text)
}
}
-static int caption_i = 0;
+static unsigned int caption_i = 0;
static const uint8_t caption_text[] = {
0x14, 0x25, 0x14, 0x25, 'L', 'I', 'B', 'Z',
'V', 'B', 'I', ' ', 'C', 'A', 'P', 'T',

Privacy Policy