WSJT-X/igray.c
Joe Taylor e1ace45403 Changed WIN32 to Win32 in wrapkarn.c and igray.c.
Corresponding change in go.bat.
Added Makefiile.win.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@65 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2006-01-09 15:06:21 +00:00

23 lines
317 B
C

#ifdef Win32
extern int __stdcall IGRAY(int *n0, int *idir)
#else
int igray_(int *n0, int *idir)
#endif
{
int n;
unsigned long sh;
unsigned long nn;
n=*n0;
if(*idir>0) return (n ^ (n >> 1));
sh = 1;
nn = (n >> sh);
while (nn > 0) {
n ^= nn;
sh <<= 1;
nn = (n >> sh);
}
return (n);
}