pike.git / src / post_modules / GL / gen.pike

version» Context lines:

pike.git/src/post_modules/GL/gen.pike:75:    typ+=({t});    }    return ({typ,tm,rows((['i':"ZT_INT",'f':"ZT_FLOAT",'d':"ZT_DOUBLE"]),    values(rt))*"|",rt});   }      array(string) gen_func(string name, string ty)   {    string res="", got="", prot, vdec, vret, fu=name;    array novec, args=({}), argt=({}); -  int r234; +  int r234, argt_cut=-1;    string rtypes;       switch(ty[0]) {    case 'V':    prot=":void";    break;    case 'I':    prot=":int";    vdec="INT32";    vret="push_int";
pike.git/src/post_modules/GL/gen.pike:130:    switch(sizeof(ty[i+1..])) {    case 3:    mi = 2; mx = 4; break;    case 4:    mi = 3; mx = 4; break;    default:    error("Can't understand + followed by %d chars.\n", sizeof(ty[i+1..]));    }    array plusfix = special_234(mi, mx, ty[i+1..]);    res += " struct zvalue4 zv4;\n"; +  argt_cut = sizeof(argt);    argt += plusfix[0];    res += "\n int r234=check_234_args(\""+name+"\", args-"+(i-1)+", "+    mi+", "+mx+", "+plusfix[1]+", "+plusfix[2]+", &zv4);\n";    r234=1;    rtypes=plusfix[3];    i=sizeof(ty);    novec=indices(allocate(mx+1))[mi..];    break;    case '#':    fu += sizeof(ty[i+1..]);    /* fallthrough */    case '!':    case '=':    array eqfix = special_234(sizeof(ty[i+1..]), sizeof(ty[i+1..]),    ty[i+1..]);    res += " struct zvalue4 zv4;\n"; -  +  argt_cut = sizeof(argt);    argt += eqfix[0];    res += "\n check_234_args(\""+name+"\", args-"+(i-1)+", "+    sizeof(ty[i+1..])+", "+sizeof(ty[i+1..])+", "+eqfix[1]+", "+    eqfix[2]+", &zv4);\n";    r234=2;    rtypes=eqfix[3];    if(ty[i]=='!')    novec=indices(ty[i+1..]);    i=sizeof(ty);    break;    case '@':    array atfix = special_234(1, 1, ty[i+1..]);    res += " union zvalue16 zv16;\n"; -  +  argt_cut = sizeof(argt);    argt += atfix[0];    res += "\n int r1n=check_1n_args(\""+name+"\", args-"+(i-1)+", "+    atfix[1]+", "+atfix[2]+", &zv16);\n";    r234=3;    rtypes=atfix[3];    i=sizeof(ty);    break;       default:    error("%s: Unknown parameter type '%c'.", name, ty[i]);    }       prot = (argt*",")+prot;    -  +  if(sizeof(argt)) +  res += "\n check_all_args(\""+name+"\", args, "+ +  ((Array.map((argt_cut<0?argt:argt[..argt_cut-1]), +  lambda(string t) { +  return Array.map(t/"|", +  lambda(string t) { +  return "BIT_"+upper_case(t); +  })*"|"; +  }))+ +  (r234?({"BIT_MANY|BIT_MIXED"}):({}))+({"0"}))*", "+");\n"; +     if(sizeof(got))    res += "\n"+got+"\n";       switch(r234)    {    case 0:    res += (vret?" res=":" ")+fu+"("+(args*",")+");\n";    break;    case 1:    if(sizeof(rtypes)==1)