[PATCH 3/5] widl: Reformat do_import().

Józef Kucia jkucia at codeweavers.com
Fri Jan 26 15:09:04 CST 2018


Use 4-space indents.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---

4 spaces are consistent with more recent changes in the file, e.g.
warning_enable(), do_warning(), is_warning_enabled().

---
 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 6afc3e7ef19c..a57ac648b8cd 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)
-- 
2.13.6




More information about the wine-devel mailing list