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:
parent
545e14eeb7
commit
d7ef4babbb
@ -124,26 +124,26 @@ snb_set_cookie(snet_buffer* snb, void* cookie)
|
|||||||
/* Return true if we canot "put" more data in the buffer */
|
/* Return true if we canot "put" more data in the buffer */
|
||||||
inline bool snb_completed(snet_buffer* snb)
|
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 */
|
/* Return true if we cannot pull more more data from the buffer */
|
||||||
inline bool snb_finished(snet_buffer* snb)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ bool snb_completed(snet_buffer* snb);
|
|||||||
/* Return true if we cannot pull more more data from the buffer */
|
/* Return true if we cannot pull more more data from the buffer */
|
||||||
bool snb_finished(snet_buffer* snb);
|
bool snb_finished(snet_buffer* snb);
|
||||||
/* Return the amount of data we can still put in the buffer */
|
/* 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 */
|
/* 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
|
/* These to functions are provided to avoid memory fragmentation
|
||||||
* allocating and freeing many snb_buffers and its possible overhead.
|
* allocating and freeing many snb_buffers and its possible overhead.
|
||||||
|
Loading…
Reference in New Issue
Block a user