diff options
Diffstat (limited to 'cbuffer.c')
-rw-r--r-- | cbuffer.c | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -1,20 +1,20 @@ -/* Lzlib - Compression library for the lzip format - Copyright (C) 2009-2019 Antonio Diaz Diaz. +/* Lzlib - Compression library for the lzip format + Copyright (C) 2009-2024 Antonio Diaz Diaz. - This library is free software. Redistribution and use in source and - binary forms, with or without modification, are permitted provided - that the following conditions are met: + This library is free software. Redistribution and use in source and + binary forms, with or without modification, are permitted provided + that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the following disclaimer in the + documentation and/or other materials provided with the distribution. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ struct Circular_buffer @@ -33,7 +33,7 @@ static inline bool Cb_init( struct Circular_buffer * const cb, cb->put = 0; cb->buffer = ( cb->buffer_size > 1 ) ? (uint8_t *)malloc( cb->buffer_size ) : 0; - return ( cb->buffer != 0 ); + return cb->buffer != 0; } static inline void Cb_free( struct Circular_buffer * const cb ) @@ -76,9 +76,9 @@ static bool Cb_unread_data( struct Circular_buffer * const cb, } -/* Copies up to 'out_size' bytes to 'out_buffer' and updates 'get'. +/* Copy up to 'out_size' bytes to 'out_buffer' and update 'get'. If 'out_buffer' is null, the bytes are discarded. - Returns the number of bytes copied or discarded. + Return the number of bytes copied or discarded. */ static unsigned Cb_read_data( struct Circular_buffer * const cb, uint8_t * const out_buffer, @@ -110,8 +110,8 @@ static unsigned Cb_read_data( struct Circular_buffer * const cb, } -/* Copies up to 'in_size' bytes from 'in_buffer' and updates 'put'. - Returns the number of bytes copied. +/* Copy up to 'in_size' bytes from 'in_buffer' and update 'put'. + Return the number of bytes copied. */ static unsigned Cb_write_data( struct Circular_buffer * const cb, const uint8_t * const in_buffer, |