Free Hero Mesh

Diff
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Differences From Artifact [64b3d009e0]:

To Artifact [7cb8ff67cc]:


2288
2289
2290
2291
2292
2293
2294

2295
2296
2297
2298
2299
2300
2301
      case OP_LABEL:
        i=look_hash(hash,LOCAL_HASH_SIZE,0x100,0x13F,ll_ndata+0x100,"data columns")?:(ll_ndata++)+0x100;
        i-=0x100;
        if(datac[i].name) ParseError("Duplicate definition\n");
        datac[i].name=strdup(tokenstr);
        if(!datac[i].name) fatal("Allocation failed\n");
        datac[i].ptr=ptr;

        ptr=level_table_code(ptr,hash);
        break;
      case OP_STRING:
        if(last) ParseError("Extra columns after fill column\n");
        for(i=0;tokenstr[i];i++) if(!(tokenstr[i]&~31)) ParseError("Improper column heading\n");
        strcpy(buf,tokenstr);
        // Data







>







2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
      case OP_LABEL:
        i=look_hash(hash,LOCAL_HASH_SIZE,0x100,0x13F,ll_ndata+0x100,"data columns")?:(ll_ndata++)+0x100;
        i-=0x100;
        if(datac[i].name) ParseError("Duplicate definition\n");
        datac[i].name=strdup(tokenstr);
        if(!datac[i].name) fatal("Allocation failed\n");
        datac[i].ptr=ptr;
        if(Tokenf(TF_COMMA)) datac[i].sgn=1;
        ptr=level_table_code(ptr,hash);
        break;
      case OP_STRING:
        if(last) ParseError("Extra columns after fill column\n");
        for(i=0;tokenstr[i];i++) if(!(tokenstr[i]&~31)) ParseError("Improper column heading\n");
        strcpy(buf,tokenstr);
        // Data
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394

2395
2396
2397
2398
2399
2400
2401
        i=look_hash(hash,LOCAL_HASH_SIZE,0x200,0x23F,ll_naggregate+0x200,"aggregates")?:(ll_naggregate++)+0x200;
        i-=0x200;
        if(aggrc[i].ag) ParseError("Duplicate definition\n");
        nxttok();
        if(!Tokenf(TF_NAME)) ParseError("Improper aggregate\n");
        switch(tokenv) {
          case OP_ADD: aggrc[i].ag=1; break;
          case OP_MIN: aggrc[i].ag=2; break;
          case OP_MAX: aggrc[i].ag=3; break;
          case OP_MIN_C: aggrc[i].ag=4; break;
          case OP_MAX_C: aggrc[i].ag=5; break;
          default: ParseError("Improper aggregate\n");
        }
        aggrc[i].ptr=ptr;
        ptr=level_table_code(ptr,hash);
        break;
      default: ParseError("Unexpected token in (LevelTable) block\n");
    }
  }
  ll_head=sqlite3_str_finish(str);
  if(!ll_head) fatal("Allocation failed\n");
  for(i=0;i<ll_ndata;i++) if(!datac[i].name) ParseError("Undefined data column\n");
  for(i=0;i<ll_naggregate;i++) if(!aggrc[i].ag) ParseError("Undefined aggregate\n");
  ll_data=realloc(datac,(ll_ndata+ll_naggregate)*sizeof(DataColumn));
  if(!ll_data) fatal("Allocation failed\n");
  for(i=0;i<ll_naggregate;i++) ll_data[i+ll_ndata]=aggrc[i];
  free(aggrc);

  // The next line will result in an invalid pointer if ptr is zero,
  // but this is harmless, since ll_code is never accessed if ptr is zero.
  ll_code=realloc(ll_code,ptr*sizeof(Uint16))?:ll_code;
  for(i=0;i<LOCAL_HASH_SIZE;i++) free(hash[i].txt);
  free(hash);
}








<
<
|
|
















>







2369
2370
2371
2372
2373
2374
2375


2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
        i=look_hash(hash,LOCAL_HASH_SIZE,0x200,0x23F,ll_naggregate+0x200,"aggregates")?:(ll_naggregate++)+0x200;
        i-=0x200;
        if(aggrc[i].ag) ParseError("Duplicate definition\n");
        nxttok();
        if(!Tokenf(TF_NAME)) ParseError("Improper aggregate\n");
        switch(tokenv) {
          case OP_ADD: aggrc[i].ag=1; break;


          case OP_MIN_C: aggrc[i].sgn=1; case OP_MIN: aggrc[i].ag=2; break;
          case OP_MAX_C: aggrc[i].sgn=1; case OP_MAX: aggrc[i].ag=3; break;
          default: ParseError("Improper aggregate\n");
        }
        aggrc[i].ptr=ptr;
        ptr=level_table_code(ptr,hash);
        break;
      default: ParseError("Unexpected token in (LevelTable) block\n");
    }
  }
  ll_head=sqlite3_str_finish(str);
  if(!ll_head) fatal("Allocation failed\n");
  for(i=0;i<ll_ndata;i++) if(!datac[i].name) ParseError("Undefined data column\n");
  for(i=0;i<ll_naggregate;i++) if(!aggrc[i].ag) ParseError("Undefined aggregate\n");
  ll_data=realloc(datac,(ll_ndata+ll_naggregate)*sizeof(DataColumn));
  if(!ll_data) fatal("Allocation failed\n");
  for(i=0;i<ll_naggregate;i++) ll_data[i+ll_ndata]=aggrc[i];
  free(aggrc);
  ll_disp=realloc(dispc,(ll_ndisp)*sizeof(DisplayColumn))?:dispc;
  // The next line will result in an invalid pointer if ptr is zero,
  // but this is harmless, since ll_code is never accessed if ptr is zero.
  ll_code=realloc(ll_code,ptr*sizeof(Uint16))?:ll_code;
  for(i=0;i<LOCAL_HASH_SIZE;i++) free(hash[i].txt);
  free(hash);
}