mojoshader_compiler.c
changeset 937 94e50ba3f956
parent 936 b4a15ef390c4
child 939 64cc93ee5a56
equal deleted inserted replaced
936:b4a15ef390c4 937:94e50ba3f956
   326 } // find_variable
   326 } // find_variable
   327 
   327 
   328 static void destroy_symbolmap(Context *ctx, SymbolMap *map)
   328 static void destroy_symbolmap(Context *ctx, SymbolMap *map)
   329 {
   329 {
   330     while (map->scope)
   330     while (map->scope)
   331         pop_symbol_scope(ctx, map);
   331         pop_symbol(ctx, map);
   332     hash_destroy(map->hash);
   332     hash_destroy(map->hash);
   333 } // destroy_symbolmap
   333 } // destroy_symbolmap
   334 
   334 
   335 
   335 
   336 // These functions are mostly for construction and cleanup of nodes in the
   336 // These functions are mostly for construction and cleanup of nodes in the
  2263         int j;
  2263         int j;
  2264         for (j = 1; j <= 4; j++)
  2264         for (j = 1; j <= 4; j++)
  2265         {
  2265         {
  2266             // "float2"
  2266             // "float2"
  2267             int len = snprintf(buf, sizeof (buf), "%s%d", types[i], j);
  2267             int len = snprintf(buf, sizeof (buf), "%s%d", types[i], j);
  2268             push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), NULL);
  2268             push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), "?");
  2269             int k;
  2269             int k;
  2270             for (k = 1; k <= 4; k++)
  2270             for (k = 1; k <= 4; k++)
  2271             {
  2271             {
  2272                 // "float2x2"
  2272                 // "float2x2"
  2273                 len = snprintf(buf, sizeof (buf), "%s%dx%d", types[i], j, k);
  2273                 len = snprintf(buf, sizeof (buf), "%s%dx%d", types[i], j, k);
  2274                 push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), NULL);
  2274                 push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), "?");
  2275             } // for
  2275             } // for
  2276         } // for
  2276         } // for
  2277     } // for
  2277     } // for
  2278 
  2278 
  2279     // Run the preprocessor/lexer/parser...
  2279     // Run the preprocessor/lexer/parser...