pike.git / src / modules / FSEvents / fsevents.cmod

version» Context lines:

pike.git/src/modules/FSEvents/fsevents.cmod:136:    *! Flags that modify the behavior of the stream being created. See Apple's FSEvents documentation    *! for details of the various flags available.    */   PIKEFUN void create(array paths, float latency, int|void sinceWhen, int|void flags)   {    int idx = 0, cnt = 0;       THIS->isRunning = 0;    THIS->_latency = latency;    -  if(sinceWhen && sinceWhen->type == T_INT) +  if(sinceWhen && TYPEOF(*sinceWhen) == T_INT)    {    THIS->_sinceWhen = sinceWhen->u.integer;    }    else    {    THIS->_sinceWhen = kFSEventStreamEventIdSinceNow;    }    -  if(flags && flags->type == T_INT) +  if(flags && TYPEOF(*flags) == T_INT)    {    THIS->_flags = flags->u.integer;    }    else    {    THIS->_flags = kFSEventStreamCreateFlagNone;    }       THIS->_paths = CFArrayCreateMutable(NULL, 0, NULL);    CFRetain(THIS->_paths);       if(paths && paths->size)    {    for(idx = 0; idx < paths->size; idx++)    {    struct svalue sv;    CFStringRef str; -  if(ITEM(paths)[idx].type != T_STRING) continue; +  if(TYPEOF(ITEM(paths)[idx]) != T_STRING) continue;    sv = ITEM(paths)[idx];    push_svalue(&sv);    f_string_to_utf8(1);    str = CFStringCreateWithBytes(NULL, (const UInt8 *)(Pike_sp[-1].u.string->str), (CFIndex)Pike_sp[-1].u.string->len, kCFStringEncodingUTF8, false);    pop_stack();    CFArrayInsertValueAtIndex( (CFMutableArrayRef)THIS->_paths, cnt, str);    cnt++;    }    }