Hi,

gnash from today doesn't compile for me. g++ complains about an invalid
cast of a pointer to "unsigned int", which doesn't quite fit on 64 bit
systems.

  lcshm.cpp: In member function ‘uint8_t* amf::LcShm::formatHeader(const 
std::string&, \
      const std::string&, bool)’:
  lcshm.cpp:416: error: cast from ‘uint8_t*’ to ‘unsigned int’ loses precision
  lcshm.cpp:416: error: cast from ‘uint8_t*’ to ‘unsigned int’ loses precision
  lcshm.cpp: In member function ‘bool amf::LcShm::connect(const std::string&)’:
  lcshm.cpp:487: error: cast from ‘char*’ to ‘unsigned int’ loses precision
  lcshm.cpp:487: error: cast from ‘uint8_t*’ to ‘unsigned int’ loses precision
  lcshm.cpp: In member function ‘void amf::LcShm::send(const std::string&, \
      const std::string&, std::vector<amf::Element*, 
std::allocator<amf::Element*> >&)’:
  lcshm.cpp:568: error: cast from ‘uint8_t*’ to ‘unsigned int’ loses precision
  lcshm.cpp:568: error: cast from ‘uint8_t*’ to ‘unsigned int’ loses precision



I suggest to use printf's %p format instead:


=== modified file 'libamf/lcshm.cpp'
--- libamf/lcshm.cpp    2009-07-22 18:25:26 +0000
+++ libamf/lcshm.cpp    2009-07-23 07:16:33 +0000
@@ -412,8 +412,7 @@

     boost::uint8_t *header = Listener::getBaseAddress();
     boost::uint8_t *ptr_FH    = Listener::getBaseAddress();
-       log_debug("Base address in 'formatHeader' is: 0x%x, 0x%x",
-                    (unsigned int) header, (unsigned int) ptr_FH);
+       log_debug("Base address in 'formatHeader' is: %p, %p", header, ptr_FH);

     // This is the initial 16 bytes of the header
     memset(ptr_FH, 0, 16 + size + 1);
@@ -483,8 +482,7 @@
     Listener::setBaseAddress(baseAddress);
     _baseaddr = baseAddress;
     parseHeader(baseAddress, tooFar);
-       log_debug("Base address in 'connect' is: 0x%x, 0x%x",
-                    (unsigned int) Shm::getAddr(), (unsigned int) _baseaddr);
+       log_debug("Base address in 'connect' is: %p, %p", Shm::getAddr(), 
_baseaddr);
 //    vector<boost::shared_ptr<Element> > ellist = parseBody(ptr);
 //     log_debug("Base address is: 0x%x, 0x%x",
 //               (unsigned int)Listener::getBaseAddress(), (unsigned 
int)_baseaddr);
@@ -564,8 +562,8 @@
      log_debug(_(" ***** The send function is called *****") );

 //     cout<<" The send function is called ! "<<endl;
-     log_debug("Base address in 'send' is: 0x%x, 0x%x",
-               (unsigned int)Listener::getBaseAddress(), (unsigned 
int)_baseaddr);
+     log_debug("Base address in 'send' is: %p, %p", Listener::getBaseAddress(),
+               _baseaddr);

 //The base address
      boost::uint8_t *baseptr = Listener::getBaseAddress();


m.
_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to