mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-19 03:52:52 +00:00
change assertions to stop splint from complaining
This commit is contained in:
parent
c7693f625e
commit
76604f847a
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "array.h"
|
#include "array.h"
|
||||||
|
|
||||||
static char UNUSED id[] = "$Id: array.c,v 1.2 2005/07/07 21:26:31 fw Exp $";
|
static char UNUSED id[] = "$Id: array.c,v 1.3 2005/07/11 14:10:53 fw Exp $";
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ array_alloc(array * a, unsigned int size, unsigned int pos)
|
|||||||
unsigned int aligned = 0;
|
unsigned int aligned = 0;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
assert(size);
|
assert(size > 0);
|
||||||
|
|
||||||
if (pos_plus1 < pos)
|
if (pos_plus1 < pos)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -110,8 +110,8 @@ array_alloc(array * a, unsigned int size, unsigned int pos)
|
|||||||
unsigned int
|
unsigned int
|
||||||
array_length(const array * const a, unsigned int membersize)
|
array_length(const array * const a, unsigned int membersize)
|
||||||
{
|
{
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
assert(membersize);
|
assert(membersize > 0);
|
||||||
|
|
||||||
if (array_UNUSABLE(a))
|
if (array_UNUSABLE(a))
|
||||||
return 0;
|
return 0;
|
||||||
@ -135,8 +135,8 @@ array_copy(array * dest, const array * const src)
|
|||||||
bool
|
bool
|
||||||
array_copyb(array * dest, const char *src, unsigned int len)
|
array_copyb(array * dest, const char *src, unsigned int len)
|
||||||
{
|
{
|
||||||
assert(dest);
|
assert(dest != NULL);
|
||||||
assert(src);
|
assert(src != NULL );
|
||||||
|
|
||||||
if (!len || !src)
|
if (!len || !src)
|
||||||
return true;
|
return true;
|
||||||
@ -172,8 +172,8 @@ array_catb(array * dest, const char *src, unsigned int len)
|
|||||||
unsigned int used;
|
unsigned int used;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
assert(dest);
|
assert(dest != NULL);
|
||||||
assert(src);
|
assert(src != NULL);
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
return true;
|
return true;
|
||||||
@ -192,7 +192,7 @@ array_catb(array * dest, const char *src, unsigned int len)
|
|||||||
|
|
||||||
ptr = dest->mem;
|
ptr = dest->mem;
|
||||||
|
|
||||||
assert(ptr);
|
assert(ptr != NULL);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Log(LOG_DEBUG,
|
Log(LOG_DEBUG,
|
||||||
@ -240,8 +240,8 @@ array_get(array * a, unsigned int membersize, unsigned int pos)
|
|||||||
{
|
{
|
||||||
unsigned int totalsize;
|
unsigned int totalsize;
|
||||||
|
|
||||||
assert(membersize);
|
assert(membersize > 0);
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
|
|
||||||
if (array_UNUSABLE(a))
|
if (array_UNUSABLE(a))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -259,7 +259,7 @@ array_get(array * a, unsigned int membersize, unsigned int pos)
|
|||||||
void
|
void
|
||||||
array_free(array * a)
|
array_free(array * a)
|
||||||
{
|
{
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Log(LOG_DEBUG,
|
Log(LOG_DEBUG,
|
||||||
"array_free: %u bytes free'd (%u bytes still used at time of free())",
|
"array_free: %u bytes free'd (%u bytes still used at time of free())",
|
||||||
@ -285,7 +285,7 @@ array_free_wipe(array * a)
|
|||||||
void *
|
void *
|
||||||
array_start(const array * const a)
|
array_start(const array * const a)
|
||||||
{
|
{
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
return a->mem;
|
return a->mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ array_start(const array * const a)
|
|||||||
void
|
void
|
||||||
array_trunc(array * a)
|
array_trunc(array * a)
|
||||||
{
|
{
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
a->used = 0;
|
a->used = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ void
|
|||||||
array_truncate(array * a, unsigned int membersize, unsigned int len)
|
array_truncate(array * a, unsigned int membersize, unsigned int len)
|
||||||
{
|
{
|
||||||
unsigned int newlen;
|
unsigned int newlen;
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
if (!safemult_uint(membersize, len, &newlen))
|
if (!safemult_uint(membersize, len, &newlen))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -317,8 +317,8 @@ array_moveleft(array * a, unsigned int membersize, unsigned int pos)
|
|||||||
{
|
{
|
||||||
unsigned int bytepos;
|
unsigned int bytepos;
|
||||||
|
|
||||||
assert(a);
|
assert(a != NULL);
|
||||||
assert(membersize);
|
assert(membersize > 0);
|
||||||
|
|
||||||
if (!pos)
|
if (!pos)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user