Commit Diff
Diff:
41aecabbf2e755f521a9101258a6a2d81ec6eea4
0b76fc1b2d2bb58b692c476c5bd4cabc10809118
Commit:
0b76fc1b2d2bb58b692c476c5bd4cabc10809118
Tree:
29651585880ea13b538418ae4bcacaff5aa1a38d
Author:
Omar Polo <op@omarpolo.com>
Date:
Fri Jul 1 20:27:25 2022 UTC
Message:
comply with -Wsign-compare
commit - 41aecabbf2e755f521a9101258a6a2d81ec6eea4
commit + 0b76fc1b2d2bb58b692c476c5bd4cabc10809118
blob - 8db10d9a51c879ea62b0acf30df7fc4f53ef6d9f
blob + 9383c856ab766a79ec7b0c424b50fe9f191bd808
--- mymenu.c
+++ mymenu.c
@@ -95,7 +95,7 @@ struct rendering {
the borders) */
int y_zero; /* like x_zero but for the y axis */
- int offset; /* scroll offset */
+ size_t offset; /* scroll offset */
short free_text;
short first_selected;
@@ -139,7 +139,7 @@ struct completion {
* The X (or Y, depending on the layour) at which the item is
* rendered
*/
- int offset;
+ ssize_t offset;
};
/* Wrap the linked list of completions */
@@ -1206,7 +1206,7 @@ confirm(enum state *status, struct rendering *r, struc
* def: the default action
*/
static enum action
-select_clicked(struct completions *cs, size_t offset, size_t first,
+select_clicked(struct completions *cs, ssize_t offset, size_t first,
enum action def)
{
ssize_t selected = first;
@@ -1219,7 +1219,7 @@ select_clicked(struct completions *cs, size_t offset,
return EXIT;
/* skip the first entry */
- for (selected += 1; selected < cs->length; ++selected) {
+ for (selected += 1; selected < (ssize_t)cs->length; ++selected) {
if (cs->completions[selected].offset == -1)
break;
Omar Polo