mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Should return 0 for tox_file_dataremaining since it returns unsigned
This commit is contained in:
parent
eec31edb1c
commit
1df2d5880d
|
@ -1314,17 +1314,17 @@ int file_data(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t *data,
|
||||||
uint64_t file_dataremaining(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t send_receive)
|
uint64_t file_dataremaining(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t send_receive)
|
||||||
{
|
{
|
||||||
if (friend_not_valid(m, friendnumber))
|
if (friend_not_valid(m, friendnumber))
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
if (send_receive == 0) {
|
if (send_receive == 0) {
|
||||||
if (m->friendlist[friendnumber].file_sending[filenumber].status == FILESTATUS_NONE)
|
if (m->friendlist[friendnumber].file_sending[filenumber].status == FILESTATUS_NONE)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
return m->friendlist[friendnumber].file_sending[filenumber].size -
|
return m->friendlist[friendnumber].file_sending[filenumber].size -
|
||||||
m->friendlist[friendnumber].file_sending[filenumber].transferred;
|
m->friendlist[friendnumber].file_sending[filenumber].transferred;
|
||||||
} else {
|
} else {
|
||||||
if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE)
|
if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
return m->friendlist[friendnumber].file_receiving[filenumber].size -
|
return m->friendlist[friendnumber].file_receiving[filenumber].size -
|
||||||
m->friendlist[friendnumber].file_receiving[filenumber].transferred;
|
m->friendlist[friendnumber].file_receiving[filenumber].transferred;
|
||||||
|
|
|
@ -620,7 +620,7 @@ int tox_filedata_size(Tox *tox, int friendnumber)
|
||||||
* send_receive is 0 if we want the sending files, 1 if we want the receiving.
|
* send_receive is 0 if we want the sending files, 1 if we want the receiving.
|
||||||
*
|
*
|
||||||
* return number of bytes remaining to be sent/received on success
|
* return number of bytes remaining to be sent/received on success
|
||||||
* return -1 on failure
|
* return 0 on failure
|
||||||
*/
|
*/
|
||||||
uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive)
|
uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive)
|
||||||
{
|
{
|
||||||
|
|
|
@ -544,7 +544,7 @@ int tox_filedata_size(Tox *tox, int friendnumber);
|
||||||
* send_receive is 0 if we want the sending files, 1 if we want the receiving.
|
* send_receive is 0 if we want the sending files, 1 if we want the receiving.
|
||||||
*
|
*
|
||||||
* return number of bytes remaining to be sent/received on success
|
* return number of bytes remaining to be sent/received on success
|
||||||
* return -1 on failure
|
* return 0 on failure
|
||||||
*/
|
*/
|
||||||
uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive);
|
uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user