MSI: a bunch of small fixes

Mike McCormack mike at codeweavers.com
Sun May 22 10:14:36 CDT 2005


ChangeLog:
* remove the unused utf8 field of an expression
* make the parse result a single assignment at top level of parsing
* abort parsing on a memory allocation failure

-------------- next part --------------
? dlls/msi/version.res
? dlls/msi/x
Index: dlls/msi/msipriv.h
===================================================================
RCS file: /home/wine/wine/dlls/msi/msipriv.h,v
retrieving revision 1.55
diff -u -p -r1.55 msipriv.h
--- dlls/msi/msipriv.h	13 May 2005 13:56:39 -0000	1.55
+++ dlls/msi/msipriv.h	22 May 2005 15:12:28 -0000
@@ -288,7 +288,7 @@ extern const WCHAR *msi_string_lookup_id
 extern UINT msi_string_get_codepage( string_table *st );
 
 
-extern UINT VIEW_find_column( MSIVIEW *view, LPWSTR name, UINT *n );
+extern UINT VIEW_find_column( MSIVIEW *view, LPCWSTR name, UINT *n );
 
 extern BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name );
 
Index: dlls/msi/msiquery.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/msiquery.c,v
retrieving revision 1.27
diff -u -p -r1.27 msiquery.c
--- dlls/msi/msiquery.c	11 May 2005 12:58:22 -0000	1.27
+++ dlls/msi/msiquery.c	22 May 2005 15:12:28 -0000
@@ -47,7 +47,7 @@ void MSI_CloseView( MSIOBJECTHDR *arg )
     msiobj_release( &query->db->hdr );
 }
 
-UINT VIEW_find_column( MSIVIEW *table, LPWSTR name, UINT *n )
+UINT VIEW_find_column( MSIVIEW *table, LPCWSTR name, UINT *n )
 {
     LPWSTR col_name;
     UINT i, count, r;
Index: dlls/msi/query.h
===================================================================
RCS file: /home/wine/wine/dlls/msi/query.h,v
retrieving revision 1.13
diff -u -p -r1.13 query.h
--- dlls/msi/query.h	14 Feb 2005 11:07:13 -0000	1.13
+++ dlls/msi/query.h	22 May 2005 15:12:28 -0000
@@ -50,7 +50,6 @@
 #define EXPR_SVAL     5
 #define EXPR_UVAL     6
 #define EXPR_STRCMP   7
-#define EXPR_UTF8     8
 #define EXPR_WILDCARD 9
 #define EXPR_COL_NUMBER_STRING 10
 
@@ -83,7 +82,6 @@ struct expr
         LPWSTR sval;
         LPWSTR column;
         UINT col_number;
-        char *utf8;
     } u;
 };
 
Index: dlls/msi/sql.y
===================================================================
RCS file: /home/wine/wine/dlls/msi/sql.y,v
retrieving revision 1.22
diff -u -p -r1.22 sql.y
--- dlls/msi/sql.y	19 May 2005 11:15:37 -0000	1.22
+++ dlls/msi/sql.y	22 May 2005 15:12:28 -0000
@@ -129,8 +129,8 @@ static struct expr * EXPR_wildcard();
 
 %type <string> column table id
 %type <column_list> selcollist
-%type <query> from unorderedsel oneselect onequery onecreate oneinsert
-%type <query> oneupdate onedelete
+%type <query> query from unorderedsel
+%type <query> oneupdate onedelete oneselect onequery onecreate oneinsert
 %type <expr> expr val column_val const_val
 %type <column_type> column_type data_type data_type_l data_count
 %type <column_info> column_def table_def
@@ -139,32 +139,20 @@ static struct expr * EXPR_wildcard();
 
 %%
 
-onequery:
-    oneselect
+query:
+    onequery
     {
         SQL_input* sql = (SQL_input*) info;
         *sql->view = $1;
     }
+    ;
+
+onequery:
+    oneselect
   | onecreate
-    {
-        SQL_input* sql = (SQL_input*) info;
-        *sql->view = $1;
-    }
   | oneinsert
-    {
-        SQL_input* sql = (SQL_input*) info;
-        *sql->view = $1;
-    }
   | oneupdate
-    {
-        SQL_input* sql = (SQL_input*) info;
-        *sql->view = $1;
-    }
   | onedelete
-    {
-        SQL_input* sql = (SQL_input*) info;
-        *sql->view = $1;
-    }
     ;
 
 oneinsert:
@@ -455,46 +443,68 @@ expr:
   | column_val TK_EQ column_val
         {
             $$ = EXPR_complex( $1, OP_EQ, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | expr TK_AND expr
         {
             $$ = EXPR_complex( $1, OP_AND, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | expr TK_OR expr
         {
             $$ = EXPR_complex( $1, OP_OR, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_EQ val
         {
             $$ = EXPR_complex( $1, OP_EQ, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_GT val
         {
             $$ = EXPR_complex( $1, OP_GT, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_LT val
         {
             $$ = EXPR_complex( $1, OP_LT, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_LE val
         {
             $$ = EXPR_complex( $1, OP_LE, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_GE val
         {
             $$ = EXPR_complex( $1, OP_GE, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_NE val
         {
             $$ = EXPR_complex( $1, OP_NE, $3 );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_IS TK_NULL
         {
             $$ = EXPR_complex( $1, OP_ISNULL, NULL );
+            if( !$$ )
+                YYABORT;
         }
   | column_val TK_IS TK_NOT TK_NULL
         {
             $$ = EXPR_complex( $1, OP_NOTNULL, NULL );
+            if( !$$ )
+                YYABORT;
         }
     ;
 
@@ -764,8 +774,6 @@ void delete_expr( struct expr *e )
         delete_expr( e->u.expr.left );
         delete_expr( e->u.expr.right );
     }
-    else if( e->type == EXPR_UTF8 )
-        HeapFree( GetProcessHeap(), 0, e->u.utf8 );
     else if( e->type == EXPR_SVAL )
         HeapFree( GetProcessHeap(), 0, e->u.sval );
     HeapFree( GetProcessHeap(), 0, e );


More information about the wine-patches mailing list