mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 22:53:28 +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")) {
|
else if (!strcmp(cmd, "/myid")) {
|
||||||
char id[FRIEND_ADDRESS_SIZE * 2 + 1] = {0};
|
char id[FRIEND_ADDRESS_SIZE * 2 + 1] = {0};
|
||||||
int i;
|
|
||||||
uint8_t address[FRIEND_ADDRESS_SIZE];
|
uint8_t address[FRIEND_ADDRESS_SIZE];
|
||||||
getaddress(m, address);
|
getaddress(m, address);
|
||||||
|
|
||||||
for (i = 0; i < FRIEND_ADDRESS_SIZE; i++) {
|
for (size_t i = 0; i < FRIEND_ADDRESS_SIZE; i++) {
|
||||||
char xx[3];
|
char xx[3];
|
||||||
snprintf(xx, sizeof(xx), "%02X", address[i] & 0xff);
|
snprintf(xx, sizeof(xx), "%02X", address[i] & 0xff);
|
||||||
strcat(id, xx);
|
strcat(id, xx);
|
||||||
|
@ -75,9 +75,8 @@ unsigned char *hex_string_to_bin(char hex_string[])
|
|||||||
size_t len = strlen(hex_string);
|
size_t len = strlen(hex_string);
|
||||||
unsigned char *val = malloc(len);
|
unsigned char *val = malloc(len);
|
||||||
char *pos = hex_string;
|
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]);
|
sscanf(pos, "%2hhx", &val[i]);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
@ -123,7 +122,7 @@ void cmd_add(ToxWindow *self, Messenger *m, char **args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < FRIEND_ADDRESS_SIZE; ++i) {
|
for (i = 0; i < FRIEND_ADDRESS_SIZE; ++i) {
|
||||||
xx[0] = id[2 * i];
|
xx[0] = id[2 * i];
|
||||||
@ -332,7 +331,7 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
|
|||||||
{
|
{
|
||||||
int newlines = 0;
|
int newlines = 0;
|
||||||
char cmd[MAX_STR_SIZE] = {0};
|
char cmd[MAX_STR_SIZE] = {0};
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < strlen(prompt_buf); ++i) {
|
for (i = 0; i < strlen(prompt_buf); ++i) {
|
||||||
if (u_cmd[i] == '\n')
|
if (u_cmd[i] == '\n')
|
||||||
@ -478,7 +477,7 @@ static void prompt_onDraw(ToxWindow *self, Messenger *m)
|
|||||||
int x, y;
|
int x, y;
|
||||||
getyx(self->window, y, x);
|
getyx(self->window, y, x);
|
||||||
(void) x;
|
(void) x;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < (strlen(prompt_buf)); ++i) {
|
for (i = 0; i < (strlen(prompt_buf)); ++i) {
|
||||||
if ((prompt_buf[i] == '\n') && (y != 0))
|
if ((prompt_buf[i] == '\n') && (y != 0))
|
||||||
|
Loading…
Reference in New Issue
Block a user