The api was wrong for some functions. Remove some null checking to be able to catch bugs.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24126 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes 2008-02-25 20:28:10 +00:00
parent 545e14eeb7
commit d7ef4babbb
2 changed files with 8 additions and 8 deletions

View File

@ -124,26 +124,26 @@ snb_set_cookie(snet_buffer* snb, void* cookie)
/* Return true if we canot "put" more data in the buffer */
inline bool snb_completed(snet_buffer* snb)
{
return (snb != NULL && (snb->expectedSize == snb->puttingSize));
return (snb->expectedSize == snb->puttingSize);
}
/* Return true if we cannot pull more more data from the buffer */
inline bool snb_finished(snet_buffer* snb)
{
return (snb != NULL && (snb->expectedSize == snb->pullingSize));
return (snb->expectedSize == snb->pullingSize);
}
inline bool snb_remaining_to_put(snet_buffer* snb)
inline uint16 snb_remaining_to_put(snet_buffer* snb)
{
return (snb != NULL && (snb->expectedSize - snb->puttingSize));
return (snb->expectedSize - snb->puttingSize);
}
inline bool snb_remaining_to_pull(snet_buffer* snb)
inline uint16 snb_remaining_to_pull(snet_buffer* snb)
{
return (snb != NULL && (snb->expectedSize - snb->pullingSize));
return (snb->expectedSize - snb->pullingSize);
}

View File

@ -60,9 +60,9 @@ bool snb_completed(snet_buffer* snb);
/* Return true if we cannot pull more more data from the buffer */
bool snb_finished(snet_buffer* snb);
/* Return the amount of data we can still put in the buffer */
bool snb_remaining_to_put(snet_buffer* snb);
uint16 snb_remaining_to_put(snet_buffer* snb);
/* Return the amount of data we can still pull in the buffer */
bool snb_remaining_to_pull(snet_buffer* snb);
uint16 snb_remaining_to_pull(snet_buffer* snb);
/* These to functions are provided to avoid memory fragmentation
* allocating and freeing many snb_buffers and its possible overhead.