mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-13 02:03:03 +01:00
warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
This commit is contained in:
parent
9bea24a317
commit
91a2ef1d84
@ -359,11 +359,10 @@ void execute(ToxWindow *self, ChatContext *ctx, Messenger *m, char *cmd)
|
||||
|
||||
else if (!strcmp(cmd, "/myid")) {
|
||||
char id[FRIEND_ADDRESS_SIZE * 2 + 1] = {0};
|
||||
int i;
|
||||
uint8_t address[FRIEND_ADDRESS_SIZE];
|
||||
getaddress(m, address);
|
||||
|
||||
for (i = 0; i < FRIEND_ADDRESS_SIZE; i++) {
|
||||
for (size_t i = 0; i < FRIEND_ADDRESS_SIZE; i++) {
|
||||
char xx[3];
|
||||
snprintf(xx, sizeof(xx), "%02X", address[i] & 0xff);
|
||||
strcat(id, xx);
|
||||
|
@ -75,9 +75,8 @@ unsigned char *hex_string_to_bin(char hex_string[])
|
||||
size_t len = strlen(hex_string);
|
||||
unsigned char *val = malloc(len);
|
||||
char *pos = hex_string;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; ++i, pos += 2)
|
||||
for (size_t i = 0; i < len; ++i, pos += 2)
|
||||
sscanf(pos, "%2hhx", &val[i]);
|
||||
|
||||
return val;
|
||||
@ -123,7 +122,7 @@ void cmd_add(ToxWindow *self, Messenger *m, char **args)
|
||||
return;
|
||||
}
|
||||
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < FRIEND_ADDRESS_SIZE; ++i) {
|
||||
xx[0] = id[2 * i];
|
||||
@ -332,7 +331,7 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
|
||||
{
|
||||
int newlines = 0;
|
||||
char cmd[MAX_STR_SIZE] = {0};
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < strlen(prompt_buf); ++i) {
|
||||
if (u_cmd[i] == '\n')
|
||||
@ -478,7 +477,7 @@ static void prompt_onDraw(ToxWindow *self, Messenger *m)
|
||||
int x, y;
|
||||
getyx(self->window, y, x);
|
||||
(void) x;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < (strlen(prompt_buf)); ++i) {
|
||||
if ((prompt_buf[i] == '\n') && (y != 0))
|
||||
|
Loading…
Reference in New Issue
Block a user