Remove DIAGASSERT

This commit is contained in:
n_hibma 2000-07-07 08:15:19 +00:00
parent 9520faa817
commit 7b59eeb53d
6 changed files with 0 additions and 50 deletions

View File

@ -41,9 +41,6 @@ hid_get_data(const void *p, const hid_item_t *h)
int data;
int i, end, offs;
_DIAGASSERT(p != NULL);
_DIAGASSERT(h != NULL);
buf = p;
hpos = h->pos; /* bit position of data */
hsize = h->report_size; /* bit length of data */
@ -73,9 +70,6 @@ hid_set_data(void *p, const hid_item_t *h, int data)
unsigned int hsize;
int i, end, offs, mask;
_DIAGASSERT(p != NULL);
_DIAGASSERT(h != NULL);
buf = p;
hpos = h->pos; /* bit position of data */
hsize = h->report_size; /* bit length of data */

View File

@ -51,8 +51,6 @@ hid_get_report_desc(fd)
struct usb_ctl_report_desc rep;
report_desc_t r;
_DIAGASSERT(fd != -1);
rep.size = 0;
if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
return (0);

View File

@ -59,9 +59,6 @@ static int min(int x, int y) { return x < y ? x : y; }
static void
hid_clear_local(hid_item_t *c)
{
_DIAGASSERT(c != NULL);
c->usage = 0;
c->usage_minimum = 0;
c->usage_maximum = 0;
@ -79,8 +76,6 @@ hid_start_parse(report_desc_t d, int kindset)
{
struct hid_data *s;
_DIAGASSERT(d != NULL);
s = malloc(sizeof *s);
memset(s, 0, sizeof *s);
s->start = s->p = d->data;
@ -92,9 +87,6 @@ hid_start_parse(report_desc_t d, int kindset)
void
hid_end_parse(hid_data_t s)
{
_DIAGASSERT(s != NULL);
while (s->cur.next) {
hid_item_t *hi = s->cur.next->next;
free(s->cur.next);
@ -114,9 +106,6 @@ hid_get_item(hid_data_t s, hid_item_t *h)
hid_item_t *hi;
int i;
_DIAGASSERT(s != NULL);
_DIAGASSERT(h != NULL);
c = &s->cur;
top:
@ -362,9 +351,6 @@ hid_report_size(report_desc_t r, enum hid_kind k, int *idp)
hid_item_t h;
int size, id;
_DIAGASSERT(r != NULL);
/* idp may be NULL */
id = 0;
if (idp)
*idp = 0;
@ -390,9 +376,6 @@ hid_locate(desc, u, k, h)
{
hid_data_t d;
_DIAGASSERT(desc != NULL);
_DIAGASSERT(h != NULL);
for (d = hid_start_parse(desc, 1<<k); hid_get_item(d, h); ) {
if (h->kind == k && !(h->flags & HIO_CONST) && h->usage == u) {
hid_end_parse(d);

View File

@ -41,9 +41,6 @@ hid_get_data(const void *p, const hid_item_t *h)
int data;
int i, end, offs;
_DIAGASSERT(p != NULL);
_DIAGASSERT(h != NULL);
buf = p;
hpos = h->pos; /* bit position of data */
hsize = h->report_size; /* bit length of data */
@ -73,9 +70,6 @@ hid_set_data(void *p, const hid_item_t *h, int data)
unsigned int hsize;
int i, end, offs, mask;
_DIAGASSERT(p != NULL);
_DIAGASSERT(h != NULL);
buf = p;
hpos = h->pos; /* bit position of data */
hsize = h->report_size; /* bit length of data */

View File

@ -51,8 +51,6 @@ hid_get_report_desc(fd)
struct usb_ctl_report_desc rep;
report_desc_t r;
_DIAGASSERT(fd != -1);
rep.size = 0;
if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
return (0);

View File

@ -59,9 +59,6 @@ static int min(int x, int y) { return x < y ? x : y; }
static void
hid_clear_local(hid_item_t *c)
{
_DIAGASSERT(c != NULL);
c->usage = 0;
c->usage_minimum = 0;
c->usage_maximum = 0;
@ -79,8 +76,6 @@ hid_start_parse(report_desc_t d, int kindset)
{
struct hid_data *s;
_DIAGASSERT(d != NULL);
s = malloc(sizeof *s);
memset(s, 0, sizeof *s);
s->start = s->p = d->data;
@ -92,9 +87,6 @@ hid_start_parse(report_desc_t d, int kindset)
void
hid_end_parse(hid_data_t s)
{
_DIAGASSERT(s != NULL);
while (s->cur.next) {
hid_item_t *hi = s->cur.next->next;
free(s->cur.next);
@ -114,9 +106,6 @@ hid_get_item(hid_data_t s, hid_item_t *h)
hid_item_t *hi;
int i;
_DIAGASSERT(s != NULL);
_DIAGASSERT(h != NULL);
c = &s->cur;
top:
@ -362,9 +351,6 @@ hid_report_size(report_desc_t r, enum hid_kind k, int *idp)
hid_item_t h;
int size, id;
_DIAGASSERT(r != NULL);
/* idp may be NULL */
id = 0;
if (idp)
*idp = 0;
@ -390,9 +376,6 @@ hid_locate(desc, u, k, h)
{
hid_data_t d;
_DIAGASSERT(desc != NULL);
_DIAGASSERT(h != NULL);
for (d = hid_start_parse(desc, 1<<k); hid_get_item(d, h); ) {
if (h->kind == k && !(h->flags & HIO_CONST) && h->usage == u) {
hid_end_parse(d);