summaryrefslogtreecommitdiff
blob: 393d1343ff46541b905d85d665d8528cdd7bcbd6 (plain)
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
diff -ru kvdr-0.64-gentoo/kvdr/ckvdrcfg.cpp kvdr-0.64-gentoo-pointer-casting/kvdr/ckvdrcfg.cpp
--- kvdr-0.64-gentoo/kvdr/ckvdrcfg.cpp	2004-09-02 18:29:54.000000000 +0200
+++ kvdr-0.64-gentoo-pointer-casting/kvdr/ckvdrcfg.cpp	2006-11-19 19:54:22.000000000 +0100
@@ -417,7 +417,7 @@
  if(-1!=((Kvdr*)p)->video_fd.handle())
  {
     ((Kvdr*)p)->OvlF(((Kvdr*)p)->display_width,((Kvdr*)p)->display_height,
-                     (int)((Kvdr*)p)->base,((Kvdr*)p)->bpp,((Kvdr*)p)->palette);
+                     ((Kvdr*)p)->base,((Kvdr*)p)->bpp,((Kvdr*)p)->palette);
     ((Kvdr*)p)->OvlP(((Kvdr*)p)->brightness,((Kvdr*)p)->colour,
                             ((Kvdr*)p)->hue,((Kvdr*)p)->contrast);
 		((Kvdr*)p)->OverlayOnOffSLOT(1);
diff -ru kvdr-0.64-gentoo/kvdr/kvdr.cpp kvdr-0.64-gentoo-pointer-casting/kvdr/kvdr.cpp
--- kvdr-0.64-gentoo/kvdr/kvdr.cpp	2006-01-21 12:45:12.000000000 +0100
+++ kvdr-0.64-gentoo-pointer-casting/kvdr/kvdr.cpp	2006-11-19 20:00:03.000000000 +0100
@@ -343,7 +343,7 @@
   //Set the Frambuffer and Image properties:
 	if (!(args->isSet("x")))
 	{
-    OvlF(display_width,display_height,(int)base,bpp,palette);
+    OvlF(display_width,display_height,base,bpp,palette);
     OvlP(brightness,colour,hue,contrast);
     ovlstat=true;
     setMaximumSize(f_size_x,f_size_y);
@@ -420,7 +420,7 @@
   ExitMixer();
 }
 
-bool Kvdr::OvlF(int SizeX, int SizeY, int FbAddr, int Bpp, int Palette)
+bool Kvdr::OvlF(int SizeX, int SizeY, void* FbAddr, int Bpp, int Palette)
 {
   // this is the problematic part!
   struct video_buffer vb;
@@ -429,7 +429,7 @@
     int result = 0;
     if (video_fd.handle() < 0)
       return false;
-    if (SizeX <= 0 || SizeY <= 0 || FbAddr == 0 || Bpp / 8 > 4 ||
+    if (SizeX <= 0 || SizeY <= 0 || FbAddr == NULL || Bpp / 8 > 4 ||
         Bpp / 8 <= 0 || Palette <= 0 || Palette > 13 || ovlClipCount < 0 ||
         SizeX > 4096 || SizeY > 4096)
     {
@@ -439,14 +439,14 @@
     }
     result |= ioctl(video_fd.handle(), VIDIOCGFBUF, &vb);
     if (result) perror("VIDIOCGFBUF");
-    if (vb.base!=(void*)FbAddr || vb.depth!=Bpp || vb.height!=SizeY ||
+    if (vb.base!=FbAddr || vb.depth!=Bpp || vb.height!=SizeY ||
         vb.width!=SizeX
         //test appearantly misleading and not required: || vb.bytesperline!=((vb.depth + 1) / 8) * vb.width
        )
     {
     	 fprintf(stderr,"kvdr and v4l-conf disagree about the framebuffer geometry\noverlay will not be shown\n");
-       fprintf(stderr,"kvdr: FbAddr=%x Bpp=%d height=%d width=%d bps=%d\n",(unsigned int)vb.base,vb.depth,vb.height,vb.width,vb.bytesperline);
-       fprintf(stderr,"v4l : FbAddr=%x Bpp=%d height=%d width=%d bps=%d\n",FbAddr,Bpp,SizeY,SizeX,(vb.depth+1)/8*vb.width);
+       fprintf(stderr,"kvdr: FbAddr=%p Bpp=%d height=%d width=%d bps=%d\n",vb.base,vb.depth,vb.height,vb.width,vb.bytesperline);
+       fprintf(stderr,"v4l : FbAddr=%p Bpp=%d height=%d width=%d bps=%d\n",FbAddr,Bpp,SizeY,SizeX,(vb.depth+1)/8*vb.width);
        ovlFbSet = ovlGeoSet = false;
        ovlClipCount = 0;
        OvlO(false);
@@ -1587,7 +1587,7 @@
 	  	return;//should never happen anyway: vid_dev taken away below kvdr
 	  }
 	}
-  OvlF(display_width,display_height,(int)base,bpp,palette);
+  OvlF(display_width,display_height,base,bpp,palette);
   OvlP(brightness,colour,hue,contrast);
 	OverlayOnOffSLOT(1);
 	usleep(20000);//not to fast...
@@ -2011,7 +2011,7 @@
       	video_fd.open(IO_ReadWrite);
       	if( !(args->isSet("x")) )
       	{
-          OvlF(display_width,display_height,(int)base,bpp,palette);
+          OvlF(display_width,display_height,base,bpp,palette);
           OvlP(brightness,colour,hue,contrast);
       		OverlayOnOffSLOT(1);
         }
diff -ru kvdr-0.64-gentoo/kvdr/kvdr.h kvdr-0.64-gentoo-pointer-casting/kvdr/kvdr.h
--- kvdr-0.64-gentoo/kvdr/kvdr.h	2006-01-21 09:17:06.000000000 +0100
+++ kvdr-0.64-gentoo-pointer-casting/kvdr/kvdr.h	2006-11-19 19:49:04.000000000 +0100
@@ -175,7 +175,7 @@
     void SetMixer(const char *device, int FrontVolume, int RearVolume);
     void ExitMixer(void);
 public: //for the configuration dialog only:
-    bool OvlF(int SizeX, int SizeY, int FbAddr, int Bpp, int Palette);
+    bool OvlF(int SizeX, int SizeY, void* FbAddr, int Bpp, int Palette);
     bool OvlP(int Brightness, int Colour, int Hue, int Contrast);
 protected:
     bool x11Event( XEvent *event );