Demo entry 6634706

C++

   

Submitted by anonymous on Aug 13, 2017 at 07:05
Language: C++. Code size: 531 Bytes.

Device::Device(const char *name,  
           int irq) :  
    // public  
    // protected  
    _name(name),  
    _debug_enabled(false),  
    // private  
    _irq(irq)  
{  
    sem_init(&_lock, 0, 1);  
  
    /* setup a default device ID. When bus_type is UNKNOWN the 
       other fields are invalid */  
    _device_id.devid = 0;  
    _device_id.devid_s.bus_type = DeviceBusType_UNKNOWN;  
    _device_id.devid_s.bus = 0;  
    _device_id.devid_s.address = 0;  
    _device_id.devid_s.devtype = 0;  
}  

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).