summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-04 20:26:27 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-04 20:26:27 -0500
commit3afd86c471e3ae6f806737908689a20eb686360a (patch)
tree4161d2b1c21b99a6708097bdedc17e3773c89913
parent46fa91da57c88a308656c2f7e0d893114f82f691 (diff)
silence clang warnings
-rw-r--r--autocomplete.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/autocomplete.c b/autocomplete.c
index 063a3d2..fb8da92 100644
--- a/autocomplete.c
+++ b/autocomplete.c
@@ -100,7 +100,7 @@ static void autocomplete_frame(Ted *ted) {
return;
}
- ted->autocomplete_cursor = (i32)mod_i64(ted->autocomplete_cursor, ncompletions);
+ ted->autocomplete_cursor = (i32)mod_i64(ted->autocomplete_cursor, (i64)ncompletions);
v2 cursor_pos = buffer_pos_to_pixels(buffer, buffer->cursor_pos);
bool open_up = cursor_pos.y > 0.5f * (buffer->y1 + buffer->y2); // should the completion menu open upwards?
@@ -115,7 +115,7 @@ static void autocomplete_frame(Ted *ted) {
Rect menu_rect = rect(V2(x, start_y), V2(menu_width, menu_height));
gl_geometry_rect(menu_rect, colors[COLOR_MENU_BG]);
//gl_geometry_rect_border(menu_rect, 1, colors[COLOR_BORDER]);
- ted->autocomplete_rect = menu_rect;
+ ted->autocomplete_rect = menu_rect;
}
// vertical padding
@@ -128,9 +128,9 @@ static void autocomplete_frame(Ted *ted) {
Rect r = rect(V2(x, start_y + cursor_entry * char_height), V2(menu_width, char_height));
gl_geometry_rect(r, colors[COLOR_MENU_HL]);
ted->cursor = ted->cursor_hand;
- }
+ }
{ // highlight cursor entry
- Rect r = rect(V2(x, start_y + ted->autocomplete_cursor * char_height), V2(menu_width, char_height));
+ Rect r = rect(V2(x, start_y + (float)ted->autocomplete_cursor * char_height), V2(menu_width, char_height));
gl_geometry_rect(r, colors[COLOR_MENU_HL]);
}