|
From: <br...@us...> - 2008-08-12 10:44:18
|
Revision: 3503
http://openvrml.svn.sourceforge.net/openvrml/?rev=3503&view=rev
Author: braden
Date: 2008-08-12 10:44:23 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Consistently use size_t when inserting stream handles into IOStreams. ptrdiff_t is signed; so mixing this with size_t can lead to badness.
Modified Paths:
--------------
branches/0.17/ChangeLog
branches/0.17/mozilla-plugin/src/openvrml.cpp
branches/0.17/src/openvrml-player/player.cpp
Modified: branches/0.17/ChangeLog
===================================================================
--- branches/0.17/ChangeLog 2008-08-12 10:43:05 UTC (rev 3502)
+++ branches/0.17/ChangeLog 2008-08-12 10:44:23 UTC (rev 3503)
@@ -1,5 +1,29 @@
2008-08-12 Braden McDaniel <br...@en...>
+ Consistently use size_t when inserting stream handles into
+ IOStreams. ptrdiff_t is signed; so mixing this with size_t can
+ lead to badness.
+
+ * src/openvrml-player/player.cpp
+ (openvrml_player_curl_source_callback(gpointer)): Cast the
+ easy_handle to size_t instead of ptrdiff_t before inserting into
+ the command stream.
+ (openvrml_player_curl_write(void *, size_t, size_t, void *)): Cast
+ the easy_handle to size_t instead of ptrdiff_t before inserting
+ into the command stream.
+ * mozilla-plugin/src/openvrml.cpp
+ (NPP_NewStream(NPP, NPMIMEType, NPStream *, NPBool, uint16 *)):
+ Cast the stream handle to size_t instead of ptrdiff_t before
+ inserting into the command stream.
+ (NPP_DestroyStream(NPP, NPStream *, NPError)): Cast the stream
+ handle to size_t instead of ptrdiff_t before inserting into the
+ command stream.
+ (NPP_Write(NPP, NPStream *, int32, int32, void *)): Cast the stream
+ handle to size_t instead of ptrdiff_t before inserting into the
+ command stream.
+
+2008-08-12 Braden McDaniel <br...@en...>
+
Use G_DEFINE_TYPE for custom GTK+ widgets.
* src/openvrml-xembed/gtkvrmlbrowser.cpp
Modified: branches/0.17/mozilla-plugin/src/openvrml.cpp
===================================================================
--- branches/0.17/mozilla-plugin/src/openvrml.cpp 2008-08-12 10:43:05 UTC (rev 3502)
+++ branches/0.17/mozilla-plugin/src/openvrml.cpp 2008-08-12 10:44:23 UTC (rev 3503)
@@ -439,7 +439,7 @@
*static_cast<plugin_instance *>(instance->pdata);
std::ostringstream command;
- command << "new-stream " << ptrdiff_t(stream) << ' ' << type << ' '
+ command << "new-stream " << size_t(stream) << ' ' << type << ' '
<< stream->url << '\n';
const ssize_t bytes_written = pluginInstance.write_command(command.str());
return (bytes_written < 0)
@@ -457,7 +457,7 @@
*static_cast<plugin_instance *>(instance->pdata);
std::ostringstream command;
- command << "destroy-stream " << ptrdiff_t(stream) << '\n';
+ command << "destroy-stream " << size_t(stream) << '\n';
const ssize_t bytes_written = pluginInstance.write_command(command.str());
return (bytes_written < 0)
? NPERR_GENERIC_ERROR
@@ -500,7 +500,7 @@
*static_cast<plugin_instance *>(instance->pdata);
std::ostringstream command;
- command << "write " << ptrdiff_t(stream) << ' ' << ' ' << len << '\n';
+ command << "write " << size_t(stream) << ' ' << ' ' << len << '\n';
for (int32 i = 0; i < len; ++i) {
command.put(static_cast<char *>(buffer)[i]);
}
Modified: branches/0.17/src/openvrml-player/player.cpp
===================================================================
--- branches/0.17/src/openvrml-player/player.cpp 2008-08-12 10:43:05 UTC (rev 3502)
+++ branches/0.17/src/openvrml-player/player.cpp 2008-08-12 10:44:23 UTC (rev 3503)
@@ -668,7 +668,7 @@
//
if (entry->second.initialized()) {
std::ostringstream command;
- command << "destroy-stream " << ptrdiff_t(msg->easy_handle)
+ command << "destroy-stream " << size_t(msg->easy_handle)
<< '\n';
const ssize_t bytes_written = ::write_command(command.str());
g_return_val_if_fail(
@@ -881,7 +881,7 @@
std::ostringstream new_stream_command;
new_stream_command
- << "new-stream " << ptrdiff_t(stream_data.handle()) << ' '
+ << "new-stream " << size_t(stream_data.handle()) << ' '
<< (type ? type : "application/octet-stream") << ' '
<< stream_data.url() << '\n';
::write_command(new_stream_command.str());
@@ -889,7 +889,7 @@
}
std::ostringstream write_command;
- write_command << "write " << ptrdiff_t(stream_data.handle()) << ' '
+ write_command << "write " << size_t(stream_data.handle()) << ' '
<< size * nmemb << '\n';
const char * data = static_cast<char *>(ptr);
for (; data != static_cast<char *>(ptr) + size * nmemb;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|