[Click] urgent help needed regarding integers

Shilpi Agarwal shilpi at cae.wisc.edu
Mon Aug 18 11:28:15 EDT 2003


Hi!!

In element simplequeue.cc , in configure function.. queuelength is parsed as an
unsigned integer but its value is stored at a pointer pointing to integer.

int new_capacity = 1000;
  if (cp_va_parse(conf, this, errh,
                  cpOptional,
                  cpUnsigned, "maximum queue length", &new_capacity,
                  0) < 0)

cpUnsigned is a 4 byte unsigned integer ..while int is a 2 byte signed value in
c++. How does it hold value more than 32768 ? Should not it be..

unsigned long int new_capacity ; 


I am writting an element and having trouble with these values. Please help me
understand this


Thanks
Shilpi..






Shilpi Agarwal
Graduate Student
Dept of Electrical Engineering
University of Wisconsin 
Madison-53706
phone:608-233-3714


More information about the click mailing list