Sfoglia il codice sorgente

*** empty log message ***

David Rose 25 anni fa
parent
commit
70e5089c32

+ 12 - 0
panda/src/express/datagramInputFile.cxx

@@ -69,6 +69,18 @@ get_datagram(Datagram &data) {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: DatagramInputFile::is_eof
+//       Access: Public, Virtual
+//  Description: Returns true if the file has reached the end-of-file.
+//               This test may only be made after a call to
+//               read_header() or get_datagram() has failed.
+////////////////////////////////////////////////////////////////////
+bool DatagramInputFile::
+is_eof() {
+  return _in.eof();
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: DatagramInputFile::is_error
 //       Access: Public, Virtual

+ 3 - 3
panda/src/express/datagramOutputFile.cxx

@@ -18,7 +18,7 @@ bool DatagramOutputFile::
 write_header(const string &header) {
   nassertr(!_wrote_first_datagram, false);
 
-  _out.write((void *)header.data(), header.size());
+  _out.write(header.data(), header.size());
   return !_out.fail();
 }
 
@@ -36,10 +36,10 @@ put_datagram(const Datagram &data) {
   // the help of a second datagram.
   Datagram size;
   size.add_uint32(data.get_length());
-  _out.write(size.get_data(), size.get_length());
+  _out.write((const char *)size.get_data(), size.get_length());
 
   // Now, write the datagram itself.
-  _out.write(data.get_data(), data.get_length());
+  _out.write((const char *)data.get_data(), data.get_length());
 
   return !_out.fail();
 }