comparison src/tests.c @ 5934:e2fae7783046 cygwin

lots of use of EMACS_INT, a few others, to eliminate all pointer truncation warnings
author Henry Thompson <ht@markup.co.uk>
date Sat, 12 Dec 2015 19:08:46 +0000
parents 65d65b52d608
children
comparison
equal deleted inserted replaced
5933:c1e8f3294298 5934:e2fae7783046
848 struct foobar { int x; int y; short z; void *q; } baz; 848 struct foobar { int x; int y; short z; void *q; } baz;
849 849
850 #define FROB(val) \ 850 #define FROB(val) \
851 do \ 851 do \
852 { \ 852 { \
853 void *pval = (void *) (val); \ 853 void *pval = (void *) ((EMACS_UINT)val); \
854 assert (GET_VOID_FROM_LISP (STORE_VOID_IN_LISP (pval)) == pval); \ 854 assert (GET_VOID_FROM_LISP (STORE_VOID_IN_LISP (pval)) == pval); \
855 } \ 855 } \
856 while (0) 856 while (0)
857 assert (FIXNUM_VALBITS >= 31); 857 assert (FIXNUM_VALBITS >= 31);
858 FROB (&baz); 858 FROB (&baz);
864 FROB (2); 864 FROB (2);
865 FROB (&Vtest_function_list); 865 FROB (&Vtest_function_list);
866 FROB (0x00000080); 866 FROB (0x00000080);
867 FROB (0x00008080); 867 FROB (0x00008080);
868 FROB (0x00808080); 868 FROB (0x00808080);
869 FROB (0x80808080); 869 FROB (0x80808080);/*this and next two fail w/o the above added (EMACS_UINT) -- HST */
870 FROB (0xCAFEBABE); 870 FROB (0xCAFEBABE);
871 FROB (0xFFFFFFFE); 871 FROB (0xFFFFFFFE);
872 #if FIXNUM_VALBITS >= 63 872 #if FIXNUM_VALBITS >= 63
873 FROB (0x0000808080808080); 873 FROB (0x0000808080808080);
874 FROB (0x8080808080808080); 874 FROB (0x8080808080808080);