Project

General

Profile

Bug #915 ยป small.c

Vadim Mutilin, 03/05/2011 06:29 PM

 
void error()
{
ERROR: goto ERROR;
}

//typedef void * drvdata_t;
typedef int * drvdata_t;

drvdata_t drvdata;

int lock(drvdata_t d)
{
int* di = (int*) d;
*di = 1;
return 0;
}

void unlock(drvdata_t f)
{
int* fi = (int*) f;
if (*fi == 0) error();
*fi = 0;
}


int main()
{
int res;
int driver_info;
drvdata_t data = &driver_info;
//lock
res = lock(data);
//lock(data);
//unlock
unlock(data);
}

    (1-1/1)