From f9e890e07ed63a9bd14e36c74525f462ad7da015 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 10 May 2006 21:55:16 +0000 Subject: Add proper licensing --- common/buffer.c | 55 +++++++++++++++++++++++++------------------------------ common/buffer.h | 5 ----- common/compat.c | 15 ++++----------- common/compat.h | 5 ----- common/sha1.c | 2 +- common/sha1.h | 6 +++--- 6 files changed, 33 insertions(+), 55 deletions(-) (limited to 'common') diff --git a/common/buffer.c b/common/buffer.c index 1ca4c6b..92d0519 100644 --- a/common/buffer.c +++ b/common/buffer.c @@ -29,11 +29,6 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. - * - * - * CONTRIBUTORS - * Nate Nielsen - * */ #include "compat.h" @@ -79,13 +74,13 @@ internal_t; #ifdef BUF_DEBUG void buffer_dump(ha_buffer_t* buf) { - internal_t* itl; - int i = 0; + internal_t* itl; + int i = 0; - fprintf(stderr, "Buffer DUMP ---------------------------\n"); + fprintf(stderr, "Buffer DUMP ---------------------------\n"); for(itl = buf->_ft; itl; itl = itl->next, i++) - fprintf(stderr, "itl %d: 0x%08X bytes\n", i, itl->end - (char*)itl); - fprintf(stderr, "---------------------------------------\n"); + fprintf(stderr, "itl %d: 0x%08X bytes\n", i, itl->end - (char*)itl); + fprintf(stderr, "---------------------------------------\n"); } #endif /* BUF_DEBUG */ @@ -100,7 +95,7 @@ void buffer_bump(ha_buffer_t* buf, int count) return; ASSERT(BUF_DELTA < BUF_INITIAL); - ASSERT(buf->_dt->next == NULL); + ASSERT(buf->_dt->next == NULL); /* Handle this common case first for efficiency */ if(buf->_rp + (count + BUF_DELTA) < buf->_dt->end) @@ -111,7 +106,7 @@ void buffer_bump(ha_buffer_t* buf, int count) return; #ifdef BUF_DEBUG - buffer_dump (buf); + buffer_dump (buf); #endif /* Okay now we know we have to extend */ @@ -185,43 +180,43 @@ void ha_bufinit(ha_buffer_t* buf) FILL_BETWEEN(INTERNAL_DATA(buf->_ft), buf->_ft->end, 0xCD); #endif - buf->_dt = buf->_ft; - ha_bufreset(buf); - } + buf->_dt = buf->_ft; + ha_bufreset(buf); + } } void ha_bufreset(ha_buffer_t* buf) { - internal_t* itl; - internal_t* next; + internal_t* itl; + internal_t* next; ASSERT(buf); ASSERT(buf->_ft); - if(ha_buferr(buf)) - return; + if(ha_buferr(buf)) + return; - /* We keep the last buffer, and free the rest */ - itl = buf->_ft; - buf->_ft = buf->_dt; + /* We keep the last buffer, and free the rest */ + itl = buf->_ft; + buf->_ft = buf->_dt; buf->_rp = buf->_pp = (char*)INTERNAL_DATA(buf->_ft); #ifdef BUF_DEBUG - fprintf(stderr, "RESET BUFFER: %d\n", buf->_ft->end - (char*)buf->_ft); + fprintf(stderr, "RESET BUFFER: %d\n", buf->_ft->end - (char*)buf->_ft); #endif - for( ; itl != buf->_ft; itl = next) - { - ASSERT(itl != NULL); - next = itl->next; + for( ; itl != buf->_ft; itl = next) + { + ASSERT(itl != NULL); + next = itl->next; #ifdef _DEBUG - FILL_BETWEEN(INTERNAL_DATA(itl), itl->end, 0xDD); + FILL_BETWEEN(INTERNAL_DATA(itl), itl->end, 0xDD); #endif #ifdef BUF_DEBUG - fprintf(stderr, "FREEING: %d\n", itl->end - (char*)itl); + fprintf(stderr, "FREEING: %d\n", itl->end - (char*)itl); #endif free(itl); - } + } #ifdef _DEBUG FILL_BETWEEN(INTERNAL_DATA(buf->_ft), buf->_ft->end, 0xCD); diff --git a/common/buffer.h b/common/buffer.h index efa3d27..ad48634 100644 --- a/common/buffer.h +++ b/common/buffer.h @@ -29,11 +29,6 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. - * - * - * CONTRIBUTORS - * Nate Nielsen - * */ #ifndef _BUFFER_H_ diff --git a/common/compat.c b/common/compat.c index 8f89000..16fc14f 100644 --- a/common/compat.c +++ b/common/compat.c @@ -29,11 +29,6 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. - * - * - * CONTRIBUTORS - * Nate Nielsen - * */ #include "compat.h" @@ -43,12 +38,10 @@ void* reallocf(void* ptr, size_t size) { - void* ret = realloc(ptr, size); - - if(!ret && size) - free(ptr); - - return ret; + void* ret = realloc(ptr, size); + if(!ret && size) + free(ptr); + return ret; } #endif diff --git a/common/compat.h b/common/compat.h index 354e2eb..02b2a5b 100644 --- a/common/compat.h +++ b/common/compat.h @@ -29,11 +29,6 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. - * - * - * CONTRIBUTORS - * Nate Nielsen - * */ #ifndef _COMPAT_H_ diff --git a/common/sha1.c b/common/sha1.c index 444e5bb..83e993f 100644 --- a/common/sha1.c +++ b/common/sha1.c @@ -139,7 +139,7 @@ void sha1_final(uchar digest[20], sha1_ctx_t* context) for (i = 0; i < 8; i++) { finalcount[i] = (uchar)((context->count[(i >= 4 ? 0 : 1)] - >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ + >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ } sha1_update(context, (uchar *)"\200", 1); while ((context->count[0] & 504) != 448) { diff --git a/common/sha1.h b/common/sha1.h index a9d1573..3cb9a91 100644 --- a/common/sha1.h +++ b/common/sha1.h @@ -24,9 +24,9 @@ extern "C" { typedef struct sha1_ctx { - unsigned long state[5]; - unsigned long count[2]; - unsigned char buffer[64]; + unsigned long state[5]; + unsigned long count[2]; + unsigned char buffer[64]; } sha1_ctx_t; -- cgit v1.2.3