Thread: luaindex type
View Single Post
05/12/14, 01:24 AM   #12
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 135
Originally Posted by CatoTheElder View Post
The application is 32 bit, so I wouldn't try passing a 64-bit value to a 32-bit application.
Hey, and why is that? Nothing is stopping you from using 64bit variables in 32bit machine/system/application. Here is some simple C application example:
Code:
#include <stdio.h>
#include <stdlib.h>

int main( int argc, char *argv[] )
{
        unsigned long long integer64bit = 0xffffffffffffffff;
        printf( "%d %llu\n", sizeof(long long), integer64bit );
        return EXIT_SUCCESS;
}
I'm runing it on my 32bit ARMv7 machine, and the output is:
Code:
[harven@fedora-arm test]$ ./bittest
8 18446744073709551615
And in the game on my 64bit Windows 7:
Lua Code:
  1. /script local var = 18446744073709551615 d(var.." type: "..type(var).." "..string.format("%l", var))
gives this:
Code:
1.844674407371e+019 type: number
Luaindex is not a type, it's a clue so we know what numbers we can use. It's like
Code:
typedef double luaindex
you can still pass -1, 3.2 and so one, but the name tells you what the function expects.
  Reply With Quote