Józef Kucia : widl: Reformat do_import().
Module: wine Branch: master Commit: 1d0ba302d9e03f6bf5503198f7765c445214f825 URL: https://source.winehq.org/git/wine.git/?a=commit;h=1d0ba302d9e03f6bf5503198f... Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Fri Jan 26 22:09:04 2018 +0100 widl: Reformat do_import(). Use 4-space indents. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.l | 88 ++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 6afc3e7..a57ac64 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -495,63 +495,63 @@ void pop_import(void) } struct imports { - char *name; - struct imports *next; + char *name; + struct imports *next; } *first_import; int do_import(char *fname) { - FILE *f; - char *path, *name; - struct imports *import; - int ptr = import_stack_ptr; - int ret, fd; - - import = first_import; - while (import && strcmp(import->name, fname)) - import = import->next; - if (import) return 0; /* already imported */ - - import = xmalloc(sizeof(struct imports)); - import->name = xstrdup(fname); - import->next = first_import; - first_import = import; - - /* don't search for a file name with a path in the include directories, - * for compatibility with MIDL */ - if (strchr( fname, '/' ) || strchr( fname, '\\' )) - path = xstrdup( fname ); - else if (!(path = wpp_find_include( fname, input_name ))) - error_loc("Unable to open include file %s\n", fname); + FILE *f; + char *path, *name; + struct imports *import; + int ptr = import_stack_ptr; + int ret, fd; + + import = first_import; + while (import && strcmp(import->name, fname)) + import = import->next; + if (import) return 0; /* already imported */ + + import = xmalloc(sizeof(struct imports)); + import->name = xstrdup(fname); + import->next = first_import; + first_import = import; + + /* don't search for a file name with a path in the include directories, + * for compatibility with MIDL */ + if (strchr( fname, '/' ) || strchr( fname, '\\' )) + path = xstrdup( fname ); + else if (!(path = wpp_find_include( fname, input_name ))) + error_loc("Unable to open include file %s\n", fname); if (import_stack_ptr == MAX_IMPORT_DEPTH) error_loc("Exceeded max import depth\n"); - import_stack[ptr].temp_name = temp_name; - import_stack[ptr].input_name = input_name; - import_stack[ptr].line_number = line_number; - import_stack_ptr++; - input_name = path; - line_number = 1; + import_stack[ptr].temp_name = temp_name; + import_stack[ptr].input_name = input_name; + import_stack[ptr].line_number = line_number; + import_stack_ptr++; + input_name = path; + line_number = 1; - name = xstrdup( "widl.XXXXXX" ); - if((fd = mkstemps( name, 0 )) == -1) - error("Could not generate a temp name from %s\n", name); + name = xstrdup( "widl.XXXXXX" ); + if((fd = mkstemps( name, 0 )) == -1) + error("Could not generate a temp name from %s\n", name); - temp_name = name; - if (!(f = fdopen(fd, "wt"))) - error("Could not open fd %s for writing\n", name); + temp_name = name; + if (!(f = fdopen(fd, "wt"))) + error("Could not open fd %s for writing\n", name); - ret = wpp_parse( path, f ); - fclose( f ); - if (ret) exit(1); + ret = wpp_parse( path, f ); + fclose( f ); + if (ret) exit(1); - if((f = fopen(temp_name, "r")) == NULL) - error_loc("Unable to open %s\n", temp_name); + if((f = fopen(temp_name, "r")) == NULL) + error_loc("Unable to open %s\n", temp_name); - import_stack[ptr].state = YY_CURRENT_BUFFER; - yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE)); - return 1; + import_stack[ptr].state = YY_CURRENT_BUFFER; + yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE)); + return 1; } void abort_import(void)
participants (1)
-
Alexandre Julliard