- avail = term->InputRead - term->InputWrite;
- if(avail < 0)
- avail += MAX_INPUT_CHARS32;
- if(avail > Length - pos)
- avail = Length/4 - pos;
-
-
- while( avail -- )
- {
- ((Uint32*)Buffer)[pos] = ((Uint32*)term->InputBuffer)[term->InputRead];
- pos ++;
- term->InputRead ++;
- term->InputRead %= MAX_INPUT_CHARS32;
- }
+ avail = term->InputWrite - term->InputRead;
+ if(avail < 0)
+ avail += MAX_INPUT_CHARS32;
+ if(avail > Length - pos)
+ avail = Length/4 - pos;
+
+ codepoint_in = (void*)term->InputBuffer;
+ codepoint_buf = Buffer;
+
+ while( avail -- )
+ {
+ codepoint_buf[pos] = codepoint_in[term->InputRead];
+ pos ++;
+ term->InputRead ++;
+ term->InputRead %= MAX_INPUT_CHARS32;