Commit ed9c7080 by kollo

fixed bugs in RSRC_LOAD on 64bit compilation

The AES stuff is still not yet really 64bit ready.

weitere verbesserungen bei den AES routinen für 64 bit.
parent 1c197c62
......@@ -14,7 +14,25 @@
#define GEMFONTSMALL "*5x8*"
#define WORD short
#ifdef _LP64
#define LONG unsigned int
#define TEDINFO_P LONG
#define BITBLK_P LONG
#define ICONBLK_P LONG
#define USRBLK_P LONG
#define OBSPEK_P LONG
#define CHAR_P LONG
#else
#define LONG unsigned long
#define TEDINFO_P TEDINFO *
#define BITBLK_P BITBLK *
#define ICONBLK_P BITBLK *
#define USRBLK_P USRBLK *
#define OBSPEK_P union obspecptr *
#define CHAR_P char *
#endif
#ifdef USE_GEM
......@@ -169,22 +187,21 @@ typedef struct {
#define BITBLK struct bit_block
#define USERBLK struct user_blk
#define PARMBLK struct parm_blk
#define USRBLK struct user_block
typedef union obspecptr
{
long index;
union obspecptr *indirect;
typedef union obspecptr {
LONG index;
OBSPEK_P indirect;
// BFOBSPEC obspec;
TEDINFO *tedinfo;
BITBLK *bitblk;
ICONBLK *iconblk;
// CICONBLK *ciconblk;
struct user_block *userblk;
char *free_string;
TEDINFO_P tedinfo;
BITBLK_P bitblk;
ICONBLK_P iconblk;
// CICONBLK_P ciconblk;
USRBLK_P userblk;
CHAR_P free_string;
} OBSPEC;
OBJECT
{
OBJECT {
WORD ob_next; /* -> object's next sibling */
WORD ob_head; /* -> head of object's children */
WORD ob_tail; /* -> tail of object's children */
......@@ -224,9 +241,9 @@ GRECT
TEDINFO
{
char *te_ptext; /* ptr to text (must be 1st) */
char *te_ptmplt; /* ptr to template */
char *te_pvalid; /* ptr to validation chrs. */
CHAR_P te_ptext; /* ptr to text (must be 1st) */
CHAR_P te_ptmplt; /* ptr to template */
CHAR_P te_pvalid; /* ptr to validation chrs. */
WORD te_font; /* font */
WORD te_fontid; /* junk word 1 */
WORD te_just; /* justification- left, right...*/
......
......@@ -293,7 +293,9 @@ static inline unsigned int catchpointerbase(void *a) {
unsigned long long pb2;
// printf("Pointer: %p\nPointerbase: %p\n",a,pointerbase);
pb2=((unsigned long long)a&0xffffffff00000000ULL);
if(pb2!=(unsigned long long)pointerbase) printf("WARNING: 64bit pointer base has changed!\n");
if(pb2!=(unsigned long long)pointerbase) {
printf("WARNING: 64bit pointer base has changed! %p --> %p\n",pointerbase, (void *)pb2);
}
pointerbase=(void *)pb2;
return((unsigned int)((unsigned long long)a&0xffffffffULL));
}
......@@ -323,13 +325,13 @@ static inline void LSWAP(short *adr) {
*adr=adr[1];
adr[1]=a;
}
static inline void LWSWAP(short *adr) {
short a;
WSWAP((char *)&adr[0]);
WSWAP((char *)&adr[1]);
a=*adr;
*adr=adr[1];
adr[1]=a;
static inline void LWSWAP(char *p) {
char a=*p;
*p=p[3];
p[3]=a;
a=p[1];
p[1]=p[2];
p[2]=a;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment