make examples g++ compileable, thanks to Juan Jose Costello

pull/1/head
dscho 20 years ago
parent 2fbf23c17f
commit 50a80e7304

@ -14,16 +14,17 @@ The good folks from
* KRFB (I think it was Tim Jansen) * KRFB (I think it was Tim Jansen)
helped also a lot (some *big* bugs!). helped also a lot (some *big* bugs!).
Karl Runge provided an x11vnc, which is a much, much improved version of my Karl Runge provides an x11vnc, which is a much, much improved version of my
original proof-of-concept. It really deserves to replace the old version, original proof-of-concept. It really deserves to replace the old version,
as it is a state-of-the-art, fast and usable program by now! as it is a state-of-the-art, fast and usable program by now! However, he
maintains it and improves it still in amazing ways!
Occasional important patches were sent by (in order I found the names in my Occasional important patches were sent by (in order I found the names in my
archives and please don't beat me, if I forgot you, but just send me an archives and please don't beat me, if I forgot you, but just send me an
email!): Akira Hatakeyama, Karl J. Runge, Justin "Zippy" Dearing, email!): Akira Hatakeyama, Karl J. Runge, Justin "Zippy" Dearing,
Oliver Mihatsch, Greg Sternberg, Werner Hofer, Giampiero Giancipoli, Oliver Mihatsch, Greg Sternberg, Werner Hofer, Giampiero Giancipoli,
Glenn Mabutt, Paul Kreiner, Erik Kunze, Mike Frysinger, Martin Waitz, Glenn Mabutt, Paul Kreiner, Erik Kunze, Mike Frysinger, Martin Waitz,
Mark McLoughlin. Mark McLoughlin, Paul Fox, Juan Jose Costello.
Probably I forgot quite a few people sending a patch here and there, which Probably I forgot quite a few people sending a patch here and there, which
really made a difference. Without those, some obscure bugs still would really made a difference. Without those, some obscure bugs still would

@ -1,3 +1,7 @@
2004-02-04 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* Make examples (at least a few) compileable with g++,
as pointed out by Juan Jose Costello
2004-01-30 Johannes E. Schindelin <Johannes.Schindelin@gmx.de> 2004-01-30 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* Thanks to Paul Fox from Bright Star Engineering, * Thanks to Paul Fox from Bright Star Engineering,
a few more memory leaks were fixed. a few more memory leaks were fixed.

@ -21,7 +21,7 @@ int main(int argc,char** argv)
bytes[128*3+2]=0; bytes[128*3+2]=0;
server->colourMap.data.bytes=bytes; server->colourMap.data.bytes=bytes;
server->frameBuffer=malloc(256*256); server->frameBuffer=(char*)malloc(256*256);
for(i=0;i<256*256;i++) for(i=0;i<256*256;i++)
server->frameBuffer[i]=(i/256); server->frameBuffer[i]=(i/256);

@ -19,7 +19,7 @@ int main(int argc,char** argv)
double r,phi; double r,phi;
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,width,height,8,3,4); rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,width,height,8,3,4);
server->frameBuffer=malloc(width*height*4); server->frameBuffer=(char*)malloc(width*height*4);
initBackground(server); initBackground(server);
server->rfbDeferUpdateTime=0; server->rfbDeferUpdateTime=0;
rfbInitServer(server); rfbInitServer(server);

@ -258,7 +258,7 @@ void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap); c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap);
c->xhot = 16; c->yhot = 24; c->xhot = 16; c->yhot = 24;
c->richSource = malloc(w*h*bpp); c->richSource = (char*)malloc(w*h*bpp);
for(j=0;j<h;j++) { for(j=0;j<h;j++) {
for(i=0;i<w;i++) { for(i=0;i<w;i++) {
c->richSource[j*w*bpp+i*bpp+0]=i*0xff/w; c->richSource[j*w*bpp+i*bpp+0]=i*0xff/w;

@ -3,7 +3,7 @@
int main(int argc,char** argv) int main(int argc,char** argv)
{ {
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4); rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4);
server->frameBuffer=malloc(400*300*4); server->frameBuffer=(char*)malloc(400*300*4);
rfbInitServer(server); rfbInitServer(server);
rfbRunEventLoop(server,-1,FALSE); rfbRunEventLoop(server,-1,FALSE);
return(0); return(0);

@ -10,7 +10,7 @@ int main(int argc,char** argv)
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,5,3,2); rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,5,3,2);
server->frameBuffer=malloc(400*300*2); server->frameBuffer=(char*)malloc(400*300*2);
f=(uint16_t*)server->frameBuffer; f=(uint16_t*)server->frameBuffer;
for(j=0;j<300;j++) for(j=0;j<300;j++)
for(i=0;i<400;i++) for(i=0;i<400;i++)

@ -44,7 +44,7 @@ void read_keys()
for(j=0,i+=2;(k=hex2number(buffer[i]))>=0;i++) for(j=0,i+=2;(k=hex2number(buffer[i]))>=0;i++)
j=j*16+k; j=j*16+k;
if(keys[j&0x3ff]) { if(keys[j&0x3ff]) {
char* x=malloc(1+strlen(keys[j&0x3ff])+1+strlen(buffer+strlen("#define "))); char* x=(char*)malloc(1+strlen(keys[j&0x3ff])+1+strlen(buffer+strlen("#define ")));
strcpy(x,keys[j&0x3ff]); strcpy(x,keys[j&0x3ff]);
strcat(x,","); strcat(x,",");
strcat(x,buffer+strlen("#define ")); strcat(x,buffer+strlen("#define "));

Loading…
Cancel
Save