iaddis / electricsheep

Automatically exported from code.google.com/p/electricsheep
1 stars 1 forks source link

DisplayOutput/OpenGL/glx.cpp:538:28: warning: ‘KeySym XKeycodeToKeysym(Display*, KeyCode, int)’ is deprecated #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. svn checkout http://electricsheep.googlecode.com/svn/trunk/ 
electricsheep-read-only
2. autogen.sh; ./configure; make
3. observe make during glx.cpp compiling

What is the expected output? What do you see instead?

g++ -DPACKAGE_NAME=\"electricsheep\" -DPACKAGE_TARNAME=\"electricsheep\" 
-DPACKAGE_VERSION=\"2.7b33-svn\" -DPACKAGE_STRING=\"electricsheep\ 2.7b33-svn\" 
-DPACKAGE_BUGREPORT=\"http://code.google.com/p/electricsheep/issues/list\" 
-DPACKAGE_URL=\"\" -DPACKAGE=\"electricsheep\" -DVERSION=\"2.7b33-svn\" 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__EXTENSIONS__=1 -D_ALL_SOURCE=1 
-D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_TANDEM_SOURCE=1 
-DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DUSE_NEW_FFMPEG_API=1 
-DHAVE_GLEE_H=1 -DHAVE_GL_GLEE_H=1 -DHAVE_LIBBOOST_THREAD=1 
-DHAVE_LIBBOOST_FILESYSTEM=1 -DHAVE_LIBBOOST_SYSTEM=1 -DHAVE_LIBTINYXML=1 
-DHAVE_LIBGLUT=1 -DHAVE_LIBGL=1 -DHAVE_LIBRT=1 -I. 
-DPACKAGE_DATA_DIR=\""/usr/local/share"\" 
-DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\" -I .. -iquote 
../DisplayOutput/OpenGL -I ../Common -I ../DisplayOutput -I 
../DisplayOutput/Renderer -I ../Common/Math -I ../ContentDecoder -I 
../TupleStorage -I ../ContentDownloader -I ../lua5.1/src -I ../Client -I 
../Networking -I ../tinyXml   -DLINUX_GNU=1 
-DSHAREDIR=\"/usr/local/share/electricsheep/\" -I/usr/include/ffmpeg   
-I/usr/include/ffmpeg   -I/usr/include/ffmpeg   -I/usr/include/ffmpeg   
-I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include       -I/usr/include/libpng15      -lrt -lz -lGL 
-D__STDC_CONSTANT_MACROS -Wno-write-strings -DHAVE_AVC_VID2=1 -g -O2 -MT glx.o 
-MD -MP -MF .deps/glx.Tpo -c -o glx.o `test -f 
'../DisplayOutput/OpenGL/glx.cpp' || echo './'`../DisplayOutput/OpenGL/glx.cpp

What version of the product are you using? On what operating system?

electricsheep 2.7b33-svn on Fedora 19 x86_64

Please provide any additional information below.

Resulting output:

g++ -DPACKAGE_NAME=\"electricsheep\" -DPACKAGE_TARNAME=\"electricsheep\" 
-DPACKAGE_VERSION=\"2.7b33-svn\" -DPACKAGE_STRING=\"electricsheep\ 2.7b33-svn\" 
-DPACKAGE_BUGREPORT=\"http://code.google.com/p/electricsheep/issues/list\" 
-DPACKAGE_URL=\"\" -DPACKAGE=\"electricsheep\" -DVERSION=\"2.7b33-svn\" 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__EXTENSIONS__=1 -D_ALL_SOURCE=1 
-D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_TANDEM_SOURCE=1 
-DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DUSE_NEW_FFMPEG_API=1 
-DHAVE_GLEE_H=1 -DHAVE_GL_GLEE_H=1 -DHAVE_LIBBOOST_THREAD=1 
-DHAVE_LIBBOOST_FILESYSTEM=1 -DHAVE_LIBBOOST_SYSTEM=1 -DHAVE_LIBTINYXML=1 
-DHAVE_LIBGLUT=1 -DHAVE_LIBGL=1 -DHAVE_LIBRT=1 -I. 
-DPACKAGE_DATA_DIR=\""/usr/local/share"\" 
-DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\" -I .. -iquote 
../DisplayOutput/OpenGL -I ../Common -I ../DisplayOutput -I 
../DisplayOutput/Renderer -I ../Common/Math -I ../ContentDecoder -I 
../TupleStorage -I ../ContentDownloader -I ../lua5.1/src -I ../Client -I 
../Networking -I ../tinyXml   -DLINUX_GNU=1 
-DSHAREDIR=\"/usr/local/share/electricsheep/\" -I/usr/include/ffmpeg   
-I/usr/include/ffmpeg   -I/usr/include/ffmpeg   -I/usr/include/ffmpeg   
-I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include       -I/usr/include/libpng15      -lrt -lz -lGL 
-D__STDC_CONSTANT_MACROS -Wno-write-strings -DHAVE_AVC_VID2=1 -g -O2 -MT glx.o 
-MD -MP -MF .deps/glx.Tpo -c -o glx.o `test -f 
'../DisplayOutput/OpenGL/glx.cpp' || echo './'`../DisplayOutput/OpenGL/glx.cpp
../DisplayOutput/OpenGL/glx.cpp: In member function ‘void 
DisplayOutput::CUnixGL::checkClientMessages()’:
../DisplayOutput/OpenGL/glx.cpp:538:28: warning: ‘KeySym 
XKeycodeToKeysym(Display*, KeyCode, int)’ is deprecated (declared at 
/usr/include/X11/Xlib.h:1699) [-Wdeprecated-declarations]
         KeySym keySymbol = XKeycodeToKeysym( m_pDisplay, xEvent.xkey.keycode, 0 );
                            ^
../DisplayOutput/OpenGL/glx.cpp:538:81: warning: ‘KeySym 
XKeycodeToKeysym(Display*, KeyCode, int)’ is deprecated (declared at 
/usr/include/X11/Xlib.h:1699) [-Wdeprecated-declarations]
         KeySym keySymbol = XKeycodeToKeysym( m_pDisplay, xEvent.xkey.keycode, 0 );
                                                                                 ^
mv -f .deps/glx.Tpo .deps/glx.Po

I am not a C++ programmer, mostly, but I was poring over some documentation and 
tried to hash together my own solution, which, as far as I know, is eliminating 
the deprecation warning, however, I am still having trouble with the client 
after it downloads sheep, so this mock patch may not even be fixing the real 
issue as far as I know (diff: orig< >new):

# diff ./DisplayOutput/OpenGL/glx.cpp 
/usr/src/electricsheep-dev/client_generic/DisplayOutput/OpenGL/glx.cpp

537,540c537,547
< 
<         KeySym keySymbol = XKeycodeToKeysym( m_pDisplay, xEvent.xkey.keycode, 
0 );
< 
<         switch( keySymbol )

---
>       /**
>        * Oh my, how did this get here? I am not so good with computer:
>        *
>          * KeySym keySymbol = XKeycodeToKeysym( m_pDisplay, 
xEvent.xkey.keycode, 0 );
>        */
>       int keysyms_per_keycode_return;
>       KeySym *keysym = 
XGetKeyboardMapping(m_pDisplay,xEvent.xkey.keycode,1,&keysyms_per_keycode_return
);
>       //keySymbol = keysym[0];
> 
>         //switch( keySymbol )
>         switch( keysym[0] )
558a566
>       XFree(keysym);

Original issue reported on code.google.com by theallis...@gmail.com on 3 Oct 2013 at 6:20

GoogleCodeExporter commented 9 years ago
It doesn't. This deprecation seems to be related to how XWindows handle 
keyboard input.

I'm currently in the process of stepping through the code of ElectricSheep 
under gdb and it appears the call to avcodec_decode_video2 on line 516 in 
ContentDecoder.cpp returns values roughly in the tens of thousands of bytes and 
the frameDecoded flag is set to zero.

I'm still new to this codebase so I'm not sure what to make of it but I'll keep 
trying.

Original comment by znovo...@gmail.com on 7 Nov 2013 at 9:08