X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=86d4626b9c7682706a97c569f9334361fc4484ff;hb=4e1ab63322b96238c5e5f7e7ef79305268aae4c0;hp=e6ee7d1dbeee6e726fad14c4046d4194950309d4;hpb=c1ee521f73699a123160c91347480a2dff6f2fc3;p=open-adventure.git diff --git a/misc.c b/misc.c index e6ee7d1..86d4626 100644 --- a/misc.c +++ b/misc.c @@ -272,7 +272,7 @@ long GETTXT(bool SKIP,bool ONEWRD, bool UPPER) { return(TEXT); } -long MAKEWD(long LETTRS) { +token_t MAKEWD(long LETTRS) { long I, L, WORD; /* Combine five uppercase letters (represented by pairs of decimal digits @@ -282,15 +282,13 @@ long I, L, WORD; * kludgey workaround, you can increment a letter by 5 by adding 50 to * the next pair of digits. */ - WORD=0; I=1; - L=LETTRS; -L10: WORD=WORD+I*(MOD(L,50)+10); - I=I*64; - if(MOD(L,100) > 50)WORD=WORD+I*5; - L=L/100; - if(L != 0) goto L10; + for (L=LETTRS; L != 0; L=L/100) { + WORD=WORD+I*(MOD(L,50)+10); + I=I*64; + if(MOD(L,100) > 50)WORD=WORD+I*5; + } I=64L*64L*64L*64L*64L/I; WORD=WORD*I; return(WORD); @@ -298,7 +296,7 @@ L10: WORD=WORD+I*(MOD(L,50)+10); #define STATE (*sTATE) -void fPUTTXT(long WORD, long *sTATE, long CASE) { +void fPUTTXT(token_t WORD, long *sTATE, long CASE) { long ALPH1, ALPH2, BYTE, DIV, I, W; /* Unpack the 30-bit value in word to obtain up to 5 integer-encoded chars,