Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!garcon!flute.cs.uiuc.edu!grunwald From: grunwald@flute.cs.uiuc.edu (Dirk Grunwald) Newsgroups: comp.windows.x Subject: Re: texx2 Message-ID: Date: 15 Feb 89 00:21:06 GMT References: Sender: news@garcon.cso.uiuc.edu Distribution: comp Organization: University of Illinois, Urbana-Champaign Lines: 80 In-reply-to: grunwald@flute.cs.uiuc.edu's message of 13 Feb 89 20:48:27 GMT As several people pointed, texx2 doesn't compile with a normal C compiler. I used `gcc', which lets you initialize automatic aggregates -- it seems this isn't a common addition (*sigh*). Many of the changes are straight-forward (moving the automatics to the global level), but many aren't (for those, XtSetArg needs to be used). Also, you can't compile it with gcc 1.33 because gcc 1.33 is buggy & dies. I used gcc 1.31. There's another problem, which is related to a mising * in ``mio.h''. A correct version follows: ---mio.h--- /* * This program is Copyright (C) 1987 by the Board of Trustees of the * University of Illinois, and by the author Dirk Grunwald. */ /* * Memory I/O: numbers. * */ #ifdef __STDC__ static inline int mGetByte(char **m) { unsigned char foo = **m; unsigned int retval = foo & 0xff; (*m)++; return retval; } static inline void mGetWord( char **m, i32 *r) { int x = mGetByte( m ) << 8; x |= mGetByte(m); *r = x; } static inline void mGet3Byte( char **m, i32 *r) { long x = mGetByte( m ) << 16; x |= ( mGetByte(m ) << 8 ); x |= mGetByte(m); *r = x; } static inline void mGetLong( char **m, i32 *r) { long x = mGetByte( m ) << 24; x |= ( mGetByte(m) << 16 ); x |= ( mGetByte(m) << 8 ); x |= mGetByte(m); *r = x; } #else #define mGetByte(m) ( *((*m)++) ) #define mGetWord(m, r) {*(r) = mGetByte(m) << 8; *(r) |= mGetByte(m);} #define mGet3Byte(m,r) {*(r) = mGetByte(m) << 16;\ *(r) |= mGetByte(m) << 8;\ *(r) |= mGetByte(m);} #define mGetLong(m, r) {*(r) = mGetByte(m) << 24;\ *(r) |= mGetByte(m) << 16;\ *(r) |= mGetByte(m) << 8;\ *(r) |= mGetByte(m);} #endif