Fix potential lisp-object ID generation overflow for excessive lisp-object creation.
src/lib/lisp-object.cpp
Thu Jul 2 21:37:42 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix potential lisp-object ID generation overflow for excessive lisp-object creation.
--- old-qt.gui/src/lib/lisp-object.cpp 2014-10-30 07:45:46.000000000 +0100
+++ new-qt.gui/src/lib/lisp-object.cpp 2014-10-30 07:45:46.000000000 +0100
@@ -29,7 +29,7 @@
/** Constructor.
* @param id The ID.
*/
-lisp_object::data::data(int id)
+lisp_object::data::data(unsigned int id)
: id(id),
is_set(true)
{ }
@@ -61,7 +61,7 @@
/** Constructor.
* @param id the ID
*/
-lisp_object::lisp_object(int id)
+lisp_object::lisp_object(unsigned int id)
: d(new data(id))
{ }
@@ -88,7 +88,7 @@
* @param id the ID
*/
void
-lisp_object::set_id(int id)
+lisp_object::set_id(unsigned int id)
{
Q_ASSERT(this->set() ? id != this->id() : true);
@@ -121,7 +121,7 @@
*
* @return the ID
*/
-int
+unsigned int
qt_smoke_lisp_object_id(const void* object)
{
return static_cast<const lisp_object*>(object)->id();
@@ -135,7 +135,7 @@
* @return @c true when the ID is set and @c false otherwise.
*/
int
-qt_smoke_lisp_object_set(const void* object)
+qt_smoke_lisp_object_is_set(const void* object)
{
return static_cast<const lisp_object*>(object)->set();
}
@@ -147,7 +147,7 @@
* @return A new lisp_object instance.
*/
void*
-qt_smoke_make_lisp_object(int id)
+qt_smoke_make_lisp_object(unsigned int id)
{
return new lisp_object(id);
}