Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pete
firmware
Commits
309d1292
Commit
309d1292
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
chore(gfx): Fix all sign-compare warnings
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
e6ae34ca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/gfx/framebuffer.c
+3
-3
3 additions, 3 deletions
lib/gfx/framebuffer.c
lib/gfx/gfx.c
+3
-3
3 additions, 3 deletions
lib/gfx/gfx.c
lib/gfx/textbuffer.c
+4
-4
4 additions, 4 deletions
lib/gfx/textbuffer.c
with
10 additions
and
10 deletions
lib/gfx/framebuffer.c
+
3
−
3
View file @
309d1292
...
...
@@ -2,8 +2,8 @@
void
fb_clear_to_color
(
struct
framebuffer
*
fb
,
Color
c
)
{
for
(
in
t
y
=
0
;
y
<
fb
->
height
;
y
++
)
{
for
(
in
t
x
=
0
;
x
<
fb
->
width
;
x
++
)
for
(
size_
t
y
=
0
;
y
<
fb
->
height
;
y
++
)
{
for
(
size_
t
x
=
0
;
x
<
fb
->
width
;
x
++
)
fb_setpixel
(
fb
,
x
,
y
,
c
);
}
}
...
...
@@ -77,7 +77,7 @@ void *fb_pixel(struct framebuffer *fb, int x, int y)
if
(
xo
<
0
||
yo
<
0
)
return
NULL
;
if
(
xo
>=
fb
->
width
||
yo
>=
fb
->
height
)
if
(
xo
>=
(
int
)
fb
->
width
||
yo
>=
(
int
)
fb
->
height
)
return
NULL
;
const
size_t
bpp
=
fb_bytes_per_pixel
(
fb
);
...
...
This diff is collapsed.
Click to expand it.
lib/gfx/gfx.c
+
3
−
3
View file @
309d1292
...
...
@@ -17,7 +17,7 @@ void gfx_setpixel(struct gfx_region *r, int x, int y, Color c)
{
if
(
x
<
0
||
y
<
0
)
return
;
if
(
x
>=
r
->
width
||
y
>=
r
->
height
)
if
(
(
size_t
)
x
>=
r
->
width
||
(
size_t
)
y
>=
r
->
height
)
return
;
fb_setpixel
(
r
->
fb
,
r
->
x
+
x
,
r
->
y
+
y
,
c
);
...
...
@@ -90,7 +90,7 @@ void gfx_puts(
while
(
*
str
)
{
// if the current position plus the width of the next character
// would bring us outside of the display ...
if
((
x
+
font
->
Width
)
>
r
->
width
)
{
if
((
x
+
font
->
Width
)
>
(
int
)
r
->
width
)
{
// ... we move down a line before printing the character
x
=
0
;
y
+=
font
->
Height
;
...
...
@@ -350,7 +350,7 @@ static void gfx_copy_region_rle_mono(
Color
white
=
gfx_color
(
reg
,
WHITE
);
Color
black
=
gfx_color
(
reg
,
BLACK
);
for
(
in
t
i
=
0
;
i
<
size
;
i
++
)
{
for
(
size_
t
i
=
0
;
i
<
size
;
i
++
)
{
Color
color
=
(
data
[
i
]
&
0x80
)
?
white
:
black
;
uint8_t
length
=
data
[
i
]
&
0x7f
;
...
...
This diff is collapsed.
Click to expand it.
lib/gfx/textbuffer.c
+
4
−
4
View file @
309d1292
...
...
@@ -41,7 +41,7 @@ static void scrollup(struct txt_buffer *tm)
for
(
int
row
=
0
;
row
<
last_row
;
row
++
)
memcpy
(
&
tm
->
text
[
row
][
0
],
&
tm
->
text
[
row
+
1
][
0
],
line_size
);
for
(
in
t
col
=
0
;
col
<
width_
(
tm
);
col
++
)
{
for
(
size_
t
col
=
0
;
col
<
width_
(
tm
);
col
++
)
{
struct
txt_glyph
*
g
=
&
tm
->
text
[
last_row
][
col
];
g
->
ch
=
' '
;
g
->
fg_color
=
tm
->
fg_color
;
...
...
@@ -63,7 +63,7 @@ static inline void advance_cursor(struct txt_buffer *tm)
const
int
last_row
=
height_
(
tm
)
-
1
;
tm
->
cursor_column
++
;
if
(
tm
->
cursor_column
>=
width_
(
tm
))
{
if
(
tm
->
cursor_column
>=
(
int
)
width_
(
tm
))
{
tm
->
cursor_column
=
0
;
tm
->
cursor_row
++
;
if
(
tm
->
cursor_row
>
last_row
)
...
...
@@ -226,9 +226,9 @@ void txt_set_cursor(struct txt_buffer *tm, int x, int y, int draw_cursor)
{
tm
->
draw_cursor
=
draw_cursor
;
if
(
x
<
0
||
x
>=
width_
(
tm
))
if
(
x
<
0
||
x
>=
(
int
)
width_
(
tm
))
return
;
if
(
y
<
0
||
y
>=
height_
(
tm
))
if
(
y
<
0
||
y
>=
(
int
)
height_
(
tm
))
return
;
tm
->
cursor_column
=
x
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment