lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 'mykey' could be changed to a string it doesn't have to be an 'int'.

Note that I'm using the address of that int, not its value.
This address is guaranteed to be unique to the module.

For this reason, I think that 

static char *mykey=MY_MODULE_NAME;

should be

static char mykey[]={MY_MODULE_NAME};

just in case the compiler removes duplicate copies of strings.

Using an array guarantees a unique address even if the string is used
elsewhere, even by a different module.