Skip to content

Commit

Permalink
LUA: Change IntPoint() to work warning-less (hopefully) everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Apr 20, 2011
1 parent 6aabfca commit 8b925cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lua/README.eos
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ Changes:
========

- Silenced a compiler warning (unused value) in liolib.c
- Increase the size of lu_hash, so it won't make any problem on 64bit
- Increased the size of lu_hash, so it won't make any problem on 64bit
systems
- Changed the definition of IntPoint() to work warning-less on systems
where sizeof(void *) < sizeof(lu_hash)
16 changes: 15 additions & 1 deletion lua/llimits.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
#ifndef llimits_h
#define llimits_h

#ifdef HAVE_CONFIG_H
#include "config.h"
#undef VERSION
#endif

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#include <limits.h>
#include <stddef.h>
Expand Down Expand Up @@ -69,7 +83,7 @@ typedef unsigned char lu_byte;
** this is for hashing only; there is no problem if the integer
** cannot hold the whole pointer value
*/
#define IntPoint(p) ((lu_hash)(p))
#define IntPoint(p) ((lu_hash)(uintptr_t)(p))



Expand Down

0 comments on commit 8b925cd

Please sign in to comment.