X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/33638fbe8c7c203f8a36de00c5cc8eb403d619a7..5ebab4c92be82299c6870c66b20829debe07a489:/minibidi.c diff --git a/minibidi.c b/minibidi.c index b211dc85..f2c68c4f 100644 --- a/minibidi.c +++ b/minibidi.c @@ -58,7 +58,7 @@ shapetypes[(xh)-SHAPE_FIRST].type : SU) /*))*/ #define leastGreaterEven(x) ( ((x)+2) &~ 1 ) typedef struct bidi_char { - wchar_t origwc, wc; + unsigned int origwc, wc; unsigned short index; } bidi_char; @@ -1194,7 +1194,7 @@ int do_bidi(bidi_char *line, int count) unsigned char currentEmbedding; unsigned char currentOverride; unsigned char tempType; - int i, j, imax, yes, bover; + int i, j, yes, bover; /* Check the presence of R or AL types as optimization */ yes = 0; @@ -1604,17 +1604,14 @@ int do_bidi(bidi_char *line, int count) * level or higher */ /* we flip the character string and leave the level array */ - imax = 0; i=0; tempType = levels[0]; while (i < count) { - if (levels[i] > tempType) { + if (levels[i] > tempType) tempType = levels[i]; - imax=i; - } i++; } - /* maximum level in tempType, its index in imax. */ + /* maximum level in tempType. */ while (tempType > 0) { /* loop from highest level to the least odd, */ /* which i assume is 1 */ flipThisRun(line, levels, tempType, count);