[LuaScriptModule] size_t being used in place of unsigned int

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

IrmatDen
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sat Feb 26, 2011 08:04

[LuaScriptModule] size_t being used in place of unsigned int

Postby IrmatDen » Thu Mar 10, 2011 19:54

Hi,

I've found a few size_t used instead of unsigned int in lua bindings, specifically in Affector.pkg, Animation.pkg, AnimationManager.pkg and Window.pkg. Having size_t leads to userdata imported in lua code, and it seems I can't get a number out of it (well, I didn't found any way to do so I mean :oops:).

Hg shelve content for the fixes:

Code: Select all

diff --git a/cegui/src/ScriptingModules/LuaScriptModule/package/Affector.pkg b/cegui/src/ScriptingModules/LuaScriptModule/package/Affector.pkg
--- a/cegui/src/ScriptingModules/LuaScriptModule/package/Affector.pkg
+++ b/cegui/src/ScriptingModules/LuaScriptModule/package/Affector.pkg
@@ -26,8 +26,8 @@
     tolua_throws|CEGUI::InvalidRequestException,error| void destroyKeyFrame(KeyFrame* keyframe);
 
     tolua_throws|CEGUI::InvalidRequestException,nil| KeyFrame* getKeyFrameAtPosition(float position) const;
-    tolua_throws|CEGUI::InvalidRequestException,nil| KeyFrame* getKeyFrameAtIdx(size_t index) const;
-    size_t getNumKeyFrames() const;
+    tolua_throws|CEGUI::InvalidRequestException,nil| KeyFrame* getKeyFrameAtIdx(unsigned int index) const;
+    unsigned int getNumKeyFrames() const;
 
 };
 
diff --git a/cegui/src/ScriptingModules/LuaScriptModule/package/Animation.pkg b/cegui/src/ScriptingModules/LuaScriptModule/package/Animation.pkg
--- a/cegui/src/ScriptingModules/LuaScriptModule/package/Animation.pkg
+++ b/cegui/src/ScriptingModules/LuaScriptModule/package/Animation.pkg
@@ -27,5 +27,5 @@
                              utf8string interpolator);
     tolua_throws|CEGUI::InvalidRequestException,error| void destroyAffector(Affector* affector);
 
-    tolua_throws|CEGUI::InvalidRequestException,nil| Affector* getAffectorAtIdx(size_t index) const;
+    tolua_throws|CEGUI::InvalidRequestException,nil| Affector* getAffectorAtIdx(unsigned int index) const;
 
@@ -31,5 +31,5 @@
 
-    size_t getNumAffectors(void) const;
+    unsigned int getNumAffectors(void) const;
 
     tolua_throws|CEGUI::InvalidRequestException,error| void defineAutoSubscription(utf8string eventName, utf8string action);
     tolua_throws|CEGUI::InvalidRequestException,error| void undefineAutoSubscription(utf8string eventName,
diff --git a/cegui/src/ScriptingModules/LuaScriptModule/package/AnimationManager.pkg b/cegui/src/ScriptingModules/LuaScriptModule/package/AnimationManager.pkg
--- a/cegui/src/ScriptingModules/LuaScriptModule/package/AnimationManager.pkg
+++ b/cegui/src/ScriptingModules/LuaScriptModule/package/AnimationManager.pkg
@@ -14,5 +14,5 @@
     tolua_throws|CEGUI::UnknownObjectException,nil| void destroyAnimation(Animation* animation);
     tolua_throws|CEGUI::UnknownObjectException,nil| void destroyAnimation(utf8string name);
     tolua_throws|CEGUI::UnknownObjectException,nil| Animation* getAnimation(utf8string name) const;
-    tolua_throws|CEGUI::InvalidRequestException,nil| Animation* getAnimationAtIdx(size_t index) const;
+    tolua_throws|CEGUI::InvalidRequestException,nil| Animation* getAnimationAtIdx(unsigned int index) const;
 
@@ -18,8 +18,8 @@
 
-    size_t getNumAnimations() const;
+    unsigned int getNumAnimations() const;
 
     tolua_throws|CEGUI::UnknownObjectException,nil| AnimationInstance* instantiateAnimation(Animation* animation);
     tolua_throws|CEGUI::UnknownObjectException,nil| AnimationInstance* instantiateAnimation(utf8string name);
     tolua_throws|CEGUI::InvalidRequestException,nil| void destroyAnimationInstance(AnimationInstance* instance);
     void destroyAllInstancesOfAnimation(Animation* animation);
 
@@ -20,8 +20,8 @@
 
     tolua_throws|CEGUI::UnknownObjectException,nil| AnimationInstance* instantiateAnimation(Animation* animation);
     tolua_throws|CEGUI::UnknownObjectException,nil| AnimationInstance* instantiateAnimation(utf8string name);
     tolua_throws|CEGUI::InvalidRequestException,nil| void destroyAnimationInstance(AnimationInstance* instance);
     void destroyAllInstancesOfAnimation(Animation* animation);
 
-    tolua_throws|CEGUI::InvalidRequestException,nil| AnimationInstance* getAnimationInstanceAtIdx(size_t index) const;
+    tolua_throws|CEGUI::InvalidRequestException,nil| AnimationInstance* getAnimationInstanceAtIdx(unsigned int index) const;
 
@@ -27,5 +27,5 @@
 
-    size_t getNumAnimationInstances() const;
+    unsigned int getNumAnimationInstances() const;
 
     void stepInstances(float delta);
 
diff --git a/cegui/src/ScriptingModules/LuaScriptModule/package/Window.pkg b/cegui/src/ScriptingModules/LuaScriptModule/package/Window.pkg
--- a/cegui/src/ScriptingModules/LuaScriptModule/package/Window.pkg
+++ b/cegui/src/ScriptingModules/LuaScriptModule/package/Window.pkg
@@ -279,7 +279,7 @@
 
     Window* clone(utf8string newName, bool deepCopy = true) const;
 
-    size_t getZIndex() const;
+    unsigned int getZIndex() const;
     bool isInFront(const Window& wnd) const;
     bool isBehind(const Window& wnd) const;
 

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [LuaScriptModule] size_t being used in place of unsigned

Postby CrazyEddie » Mon Mar 14, 2011 09:29

Thanks for these fixes, I will get them applied soon.

CE

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [LuaScriptModule] size_t being used in place of unsigned

Postby CrazyEddie » Wed Mar 16, 2011 14:42

I've applied this fix in v0-7; it should get merged back into default some time soon (may be later today). Thanks again.

CE

IrmatDen
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sat Feb 26, 2011 08:04

Re: [LuaScriptModule] size_t being used in place of unsigned

Postby IrmatDen » Wed Mar 16, 2011 16:19

You're welcome :)


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 4 guests