revised model loading order
[csRadar.git] / vdf.h
diff --git a/vdf.h b/vdf.h
index 2b77a7a4f3bf65fc87aa0b7c54bc7978d8e1a782..cacf694557fdc5ad61544c194db74e347a1f15d1 100644 (file)
--- a/vdf.h
+++ b/vdf.h
@@ -1,12 +1,12 @@
 #define vdf_foreach( NODE, STR, AS ) \
-int __vdf_it_##__LINE__ = 0; \
+int __vdf_it_##AS = 0; \
 vdf_node * AS;\
-while( (AS = vdf_next( NODE, STR, &__vdf_it_##__LINE__ )) )
+while( (AS = vdf_next( NODE, STR, &__vdf_it_##AS )) )
 
 #define kv_foreach( NODE, STR, AS ) \
-int __kv_it_##__LINE__ = 0; \
+int __kv_it_##AS = 0; \
 const char * AS;\
-while( (AS = kv_iter( NODE, STR, &__kv_it_##__LINE__ )) )
+while( (AS = kv_iter( NODE, STR, &__kv_it_##AS )) )
 
 #include <stdio.h>
 #include <stdint.h>
@@ -105,6 +105,7 @@ struct vdf_node
        vdf_kv  *pairs;
        
        u32             user;
+       u32             user1;
 };
 
 vdf_node *vdf_next( vdf_node *node, const char *name, int *it )
@@ -419,7 +420,7 @@ void vdf_parse_string( vdf_ctx *ctx )
                
                if( vdf_line_control( ctx ) )
                {
-                       fprintf( stderr, "Unexpected end of line character (Line: %u)\n", ctx->lines );
+                       log_error( "Unexpected end of line character (Line: %u)\n", ctx->lines );
                        return;
                }
        
@@ -433,7 +434,7 @@ int vdf_parse_structure( vdf_ctx *ctx )
        {
                if( ctx->st.tokens[0] || !ctx->st.expect_decl )
                {
-                       fprintf( stderr, "Unexpected token '{' (Line: %u)\n", ctx->lines );
+                       log_error( "Unexpected token '{' (Line: %u)\n", ctx->lines );
                        ctx->errors ++;
                }
                
@@ -449,7 +450,7 @@ int vdf_parse_structure( vdf_ctx *ctx )
        {
                if( !ctx->st.pnode->parent )
                {
-                       fprintf( stderr, "Unexpected token '}' (Line: %u)\n", ctx->lines );
+                       log_error( "Unexpected token '}' (Line: %u)\n", ctx->lines );
                        ctx->errors ++;
                }
                else
@@ -470,7 +471,7 @@ void vdf_parse_begin_token( vdf_ctx *ctx, char *ptr )
 
        if( ctx->st.expect_decl )
        {
-               fprintf( stderr, "Unexpected token '%s' (Line: %u)\n", ctx->name, ctx->lines );
+               log_error( "Unexpected token '%s' (Line: %u)\n", ctx->name, ctx->lines );
                ctx->errors ++;
        }
 }
@@ -542,7 +543,6 @@ int vdf_load_into( const char *fn, vdf_node *node )
        
        if( !text_src )
        {
-               fprintf( stderr, "vdf open failed\n" );
                return 0;
        }