1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 05:23:02 +01:00

Fixed some warnings.

This commit is contained in:
irungentoo 2013-08-24 19:16:43 -04:00
parent c628517474
commit e6a13feae8
3 changed files with 10 additions and 7 deletions

View File

@ -220,7 +220,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
/* make sure the string has at least non-space character */ /* make sure the string has at least non-space character */
if (!string_is_empty(line)) { if (!string_is_empty(line)) {
uint8_t selfname[TOX_MAX_NAME_LENGTH]; uint8_t selfname[TOX_MAX_NAME_LENGTH];
getself_name(m, selfname, sizeof(selfname)); tox_getselfname(m, selfname, sizeof(selfname));
wattron(ctx->history, COLOR_PAIR(2)); wattron(ctx->history, COLOR_PAIR(2));
wprintw(ctx->history, "[%02d:%02d:%02d] ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); wprintw(ctx->history, "[%02d:%02d:%02d] ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
@ -279,7 +279,7 @@ void execute(ToxWindow *self, ChatContext *ctx, Tox *m, char *cmd)
wattroff(ctx->history, COLOR_PAIR(2)); wattroff(ctx->history, COLOR_PAIR(2));
uint8_t selfname[TOX_MAX_NAME_LENGTH]; uint8_t selfname[TOX_MAX_NAME_LENGTH];
int len = getself_name(m, selfname, sizeof(selfname)); int len = tox_getselfname(m, selfname, sizeof(selfname));
char msg[MAX_STR_SIZE - len - 4]; char msg[MAX_STR_SIZE - len - 4];
snprintf(msg, sizeof(msg), "* %s %s\n", (uint8_t *) selfname, action); snprintf(msg, sizeof(msg), "* %s %s\n", (uint8_t *) selfname, action);
@ -358,7 +358,7 @@ void execute(ToxWindow *self, ChatContext *ctx, Tox *m, char *cmd)
char id[TOX_FRIEND_ADDRESS_SIZE * 2 + 1] = {0}; char id[TOX_FRIEND_ADDRESS_SIZE * 2 + 1] = {0};
int i; int i;
uint8_t address[TOX_FRIEND_ADDRESS_SIZE]; uint8_t address[TOX_FRIEND_ADDRESS_SIZE];
getaddress(m, address); tox_getaddress(m, address);
for (i = 0; i < TOX_FRIEND_ADDRESS_SIZE; i++) { for (i = 0; i < TOX_FRIEND_ADDRESS_SIZE; i++) {
char xx[3]; char xx[3];

View File

@ -32,6 +32,9 @@
#include "prompt.h" #include "prompt.h"
#include "friendlist.h" #include "friendlist.h"
#ifndef PACKAGE_DATADIR
#define PACKAGE_DATADIR "."
#endif
/* Export for use in Callbacks */ /* Export for use in Callbacks */
char *DATA_FILE = NULL; char *DATA_FILE = NULL;
char *SRVLIST_FILE = NULL; char *SRVLIST_FILE = NULL;
@ -291,7 +294,7 @@ static void load_data(Tox *m, char *path)
tox_load(m, buf, len); tox_load(m, buf, len);
uint32_t i; uint32_t i = 0;
char name[TOX_MAX_NAME_LENGTH]; char name[TOX_MAX_NAME_LENGTH];
while (tox_getname(m, i, (uint8_t *)name) != -1) { while (tox_getname(m, i, (uint8_t *)name) != -1) {

View File

@ -89,7 +89,7 @@ void cmd_accept(ToxWindow *self, Tox *m, char **args)
return; return;
} }
num = m_addfriend_norequest(m, pending_requests[num]); num = tox_addfriend_norequest(m, pending_requests[num]);
if (num == -1) if (num == -1)
wprintw(self->window, "Failed to add friend.\n"); wprintw(self->window, "Failed to add friend.\n");
@ -139,7 +139,7 @@ void cmd_add(ToxWindow *self, Tox *m, char **args)
id[i] = toupper(id[i]); id[i] = toupper(id[i]);
} }
int num = m_addfriend(m, id_bin, (uint8_t *) msg, strlen(msg) + 1); int num = tox_addfriend(m, id_bin, (uint8_t *) msg, strlen(msg) + 1);
switch (num) { switch (num) {
case TOX_FAERR_TOOLONG: case TOX_FAERR_TOOLONG:
@ -255,7 +255,7 @@ void cmd_myid(ToxWindow *self, Tox *m, char **args)
char id[TOX_FRIEND_ADDRESS_SIZE * 2 + 1] = {0}; char id[TOX_FRIEND_ADDRESS_SIZE * 2 + 1] = {0};
size_t i; size_t i;
uint8_t address[TOX_FRIEND_ADDRESS_SIZE]; uint8_t address[TOX_FRIEND_ADDRESS_SIZE];
getaddress(m, address); tox_getaddress(m, address);
for (i = 0; i < TOX_FRIEND_ADDRESS_SIZE; ++i) { for (i = 0; i < TOX_FRIEND_ADDRESS_SIZE; ++i) {
char xx[3]; char xx[3];