diff options
author | Simon Glass | 2020-07-02 21:12:16 -0600 |
---|---|---|
committer | Bin Meng | 2020-07-09 12:33:24 +0800 |
commit | a254d11dda3064489eeffa5cb935b212986627f3 (patch) | |
tree | 7b7b43977f4e202e29125f0f9a006f009738ce06 /board/tcl/sl50 | |
parent | 6a2ea434ea9f38fff6b133b5b8cc4db302a1a84c (diff) |
video: Split out expression parts into variables
The functions in this file do similar things but not always in the same
way. To make the code easier to read and compare, use a separate 'linenum'
variable in every function. This is then multiplied by the line length to
get the offset within the frame buffer to modify. Also use an 'x' variable
to hold the pixel position within that line. This is multipled by the
pixel size and added to the offset.
Also move the pbytes declaration up a little with the other long lines.
A side effect of splitting out these variables is that they are promoted
to int, i.e. a signed type, from the unsigned short used in the
vidconsole_priv struct. This would be necessary should any of the
variables go negative. At present this can actually happen in
console_putc_xy_2(), if the display width is not a multiple of the
character size (see next patch).
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'board/tcl/sl50')
0 files changed, 0 insertions, 0 deletions