1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
$NetBSD: patch-ad,v 1.6 2006/06/15 21:58:55 dogcow Exp $
--- libmpdemux/tvi_bsdbt848.c.orig 2006-06-15 14:41:49.000000000 -0700
+++ libmpdemux/tvi_bsdbt848.c 2006-06-15 14:42:51.000000000 -0700
@@ -178,6 +178,7 @@ tvi_handle_t *tvi_init_bsdbt848(char *de
static int control(priv_t *priv, int cmd, void *arg)
{
+ int *bogus = (int *) arg;
switch(cmd)
{
@@ -195,13 +196,13 @@ static int control(priv_t *priv, int cmd
return(TVI_CONTROL_FALSE);
}
- (int)*(void **)arg = priv->tunerfreq;
+ *bogus = priv->tunerfreq;
return(TVI_CONTROL_TRUE);
}
case TVI_CONTROL_TUN_SET_FREQ:
{
- priv->tunerfreq = (int)*(void **)arg;
+ priv->tunerfreq = *bogus;
if(ioctl(priv->tunerfd, TVTUNER_SETFREQ, &priv->tunerfreq) < 0)
{
@@ -225,13 +226,13 @@ static int control(priv_t *priv, int cmd
return(TVI_CONTROL_FALSE);
}
- (int)*(void **)arg = priv->input;
+ *bogus = priv->input;
return(TVI_CONTROL_TRUE);
}
case TVI_CONTROL_SPC_SET_INPUT:
{
- priv->input = getinput((int)*(void **)arg);
+ priv->input = getinput(*bogus);
if(ioctl(priv->btfd, METEORSINPUT, &priv->input) < 0)
{
@@ -250,17 +251,17 @@ static int control(priv_t *priv, int cmd
case TVI_CONTROL_AUD_GET_FORMAT:
{
- (int)*(void **)arg = AF_FORMAT_S16_LE;
+ *bogus = AF_FORMAT_S16_LE;
return(TVI_CONTROL_TRUE);
}
case TVI_CONTROL_AUD_GET_CHANNELS:
{
- (int)*(void **)arg = 2;
+ *bogus = 2;
return(TVI_CONTROL_TRUE);
}
case TVI_CONTROL_AUD_SET_SAMPLERATE:
{
- int dspspeed = (int)*(void **)arg;
+ int dspspeed = *bogus;
if(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &dspspeed) == -1)
{
@@ -279,12 +280,12 @@ static int control(priv_t *priv, int cmd
}
case TVI_CONTROL_AUD_GET_SAMPLERATE:
{
- (int)*(void **)arg = priv->dspspeed;
+ *bogus = priv->dspspeed;
return(TVI_CONTROL_TRUE);
}
case TVI_CONTROL_AUD_GET_SAMPLESIZE:
{
- (int)*(void **)arg = priv->dspsamplesize/8;
+ *bogus = priv->dspsamplesize/8;
return(TVI_CONTROL_TRUE);
}
@@ -296,7 +297,7 @@ static int control(priv_t *priv, int cmd
case TVI_CONTROL_TUN_SET_NORM:
{
- int req_mode = (int)*(void **)arg;
+ int req_mode = *bogus;
u_short tmp_fps;
priv->iformat = METEOR_FMT_AUTOMODE;
@@ -381,19 +382,19 @@ static int control(priv_t *priv, int cmd
}
case TVI_CONTROL_VID_GET_FORMAT:
- (int)*(void **)arg = IMGFMT_UYVY;
+ *bogus = IMGFMT_UYVY;
return(TVI_CONTROL_TRUE);
case TVI_CONTROL_VID_SET_FORMAT:
{
- int req_fmt = (int)*(void **)arg;
+ int req_fmt = *bogus;
if(req_fmt != IMGFMT_UYVY) return(TVI_CONTROL_FALSE);
return(TVI_CONTROL_TRUE);
}
case TVI_CONTROL_VID_SET_WIDTH:
- priv->geom.columns = (int)*(void **)arg;
+ priv->geom.columns = *bogus;
if(priv->geom.columns > priv->maxwidth)
{
@@ -409,11 +410,11 @@ static int control(priv_t *priv, int cmd
return(TVI_CONTROL_TRUE);
case TVI_CONTROL_VID_GET_WIDTH:
- (int)*(void **)arg = priv->geom.columns;
+ *bogus = priv->geom.columns;
return(TVI_CONTROL_TRUE);
case TVI_CONTROL_VID_SET_HEIGHT:
- priv->geom.rows = (int)*(void **)arg;
+ priv->geom.rows = *bogus;
if(priv->geom.rows > priv->maxheight)
{
@@ -434,7 +435,7 @@ static int control(priv_t *priv, int cmd
return(TVI_CONTROL_TRUE);
case TVI_CONTROL_VID_GET_HEIGHT:
- (int)*(void **)arg = priv->geom.rows;
+ *bogus = priv->geom.rows;
return(TVI_CONTROL_TRUE);
case TVI_CONTROL_VID_GET_FPS:
@@ -443,7 +444,7 @@ static int control(priv_t *priv, int cmd
/*
case TVI_CONTROL_VID_SET_FPS:
- priv->fps = (int)*(void **)arg;
+ priv->fps = *bogus;
if(priv->fps > priv->maxfps) priv->fps = priv->maxfps;
|