mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Data::getSize now uses size_t instead of int
This commit is contained in:
+4
-1
@@ -25,6 +25,9 @@
|
||||
#include "config.h"
|
||||
#include "Object.h"
|
||||
|
||||
// C
|
||||
#include <stddef.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
@@ -49,7 +52,7 @@ public:
|
||||
/**
|
||||
* Gets the size of the Data in bytes.
|
||||
**/
|
||||
virtual int getSize() const = 0;
|
||||
virtual size_t getSize() const = 0;
|
||||
|
||||
}; // Data
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ Data *luax_checkdata(lua_State *L, int idx)
|
||||
int w_Data_getString(lua_State *L)
|
||||
{
|
||||
Data *t = luax_checkdata(L, 1);
|
||||
lua_pushlstring(L, (const char *) t->getData(), (size_t) t->getSize());
|
||||
lua_pushlstring(L, (const char *) t->getData(), t->getSize());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ int w_Data_getPointer(lua_State *L)
|
||||
int w_Data_getSize(lua_State *L)
|
||||
{
|
||||
Data *t = luax_checkdata(L, 1);
|
||||
lua_pushinteger(L, t->getSize());
|
||||
lua_pushnumber(L, (lua_Number) t->getSize());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user