[msitools] Replace WARN with g_warning



commit cc431bfc4c19aac79d98546d4abae4e4ad35d500
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Wed Feb 6 14:12:11 2013 +0100

    Replace WARN with g_warning

 libmsi/debug.h               |    2 --
 libmsi/libmsi-database.c     |   16 ++++++++--------
 libmsi/libmsi-query.c        |    2 +-
 libmsi/libmsi-record.c       |    2 +-
 libmsi/libmsi-summary-info.c |    2 +-
 libmsi/storages.c            |    2 +-
 libmsi/streams.c             |    6 +++---
 libmsi/string.c              |    4 ++--
 libmsi/table.c               |   34 +++++++++++++++++-----------------
 libmsi/where.c               |    4 ++--
 10 files changed, 36 insertions(+), 38 deletions(-)
---
diff --git a/libmsi/debug.h b/libmsi/debug.h
index 626239d..dbd1da7 100644
--- a/libmsi/debug.h
+++ b/libmsi/debug.h
@@ -112,8 +112,6 @@ static inline const char *debugstr_a( const char *s )  { return wine_dbgstr_an(
 #undef ERR  /* Solaris got an 'ERR' define in <sys/reg.h> */
 #define TRACE(fmt, ...)     (void)0 // WINE_DPRINTF(TRACE, __func__, fmt, ## __VA_ARGS__)
 #define TRACE_ON(channel)   0
-#define WARN(fmt, ...)      (void)0 // WINE_DPRINTF(WARN, __func__, fmt, ## __VA_ARGS__)
-#define WARN_ON(channel)    0
 
 #ifdef __cplusplus
 }
diff --git a/libmsi/libmsi-database.c b/libmsi/libmsi-database.c
index edebd13..54ab035 100644
--- a/libmsi/libmsi-database.c
+++ b/libmsi/libmsi-database.c
@@ -475,7 +475,7 @@ unsigned clone_infile_stream( LibmsiDatabase *db, const char *name, GsfInput **s
         stream = gsf_input_dup( stream, NULL );
         if( !stream )
         {
-            WARN("failed to clone stream\n");
+            g_warning("failed to clone stream\n");
             return LIBMSI_RESULT_FUNCTION_FAILED;
         }
 
@@ -642,14 +642,14 @@ LibmsiResult _libmsi_database_start_transaction(LibmsiDatabase *db)
     out = gsf_output_stdio_new(db->outpath, NULL);
     if (!out)
     {
-        WARN("open file failed for %s\n", debugstr_a(db->outpath));
+        g_warning("open file failed for %s\n", debugstr_a(db->outpath));
         return LIBMSI_RESULT_OPEN_FAILED;
     }
     stg = gsf_outfile_msole_new(out);
     g_object_unref(G_OBJECT(out));
     if (!stg)
     {
-        WARN("open failed for %s\n", debugstr_a(db->outpath));
+        g_warning("open failed for %s\n", debugstr_a(db->outpath));
         return LIBMSI_RESULT_OPEN_FAILED;
     }
 
@@ -657,7 +657,7 @@ LibmsiResult _libmsi_database_start_transaction(LibmsiDatabase *db)
                                         db->flags & LIBMSI_DB_FLAGS_PATCH ?
                                         clsid_msi_patch : clsid_msi_database ))
     {
-        WARN("set guid failed\n");
+        g_warning("set guid failed\n");
         ret = LIBMSI_RESULT_FUNCTION_FAILED;
         goto end;
     }
@@ -839,7 +839,7 @@ static char *msi_build_createsql_columns(char **columns_data, char **types, unsi
                     type = type_long;
                 else
                 {
-                    WARN("invalid int width %u\n", len);
+                    g_warning("invalid int width %u\n", len);
                     msi_free(columns);
                     return NULL;
                 }
@@ -2187,14 +2187,14 @@ LibmsiResult _libmsi_database_open(LibmsiDatabase *db)
     in = gsf_input_stdio_new(db->path, NULL);
     if (!in)
     {
-        WARN("open file failed for %s\n", debugstr_a(db->path));
+        g_warning("open file failed for %s\n", debugstr_a(db->path));
         return LIBMSI_RESULT_OPEN_FAILED;
     }
     stg = gsf_infile_msole_new( in, NULL );
     g_object_unref(G_OBJECT(in));
     if( !stg )
     {
-        WARN("open failed for %s\n", debugstr_a(db->path));
+        g_warning("open failed for %s\n", debugstr_a(db->path));
         return LIBMSI_RESULT_OPEN_FAILED;
     }
 
@@ -2252,7 +2252,7 @@ unsigned _libmsi_database_apply_transform( LibmsiDatabase *db,
     in = gsf_input_stdio_new(szTransformFile, NULL);
     if (!in)
     {
-        WARN("open file failed for transform %s\n", debugstr_a(szTransformFile));
+        g_warning("open file failed for transform %s\n", debugstr_a(szTransformFile));
         return LIBMSI_RESULT_OPEN_FAILED;
     }
     stg = gsf_infile_msole_new( in, NULL );
diff --git a/libmsi/libmsi-query.c b/libmsi/libmsi-query.c
index e34967b..aa3e2b1 100644
--- a/libmsi/libmsi-query.c
+++ b/libmsi/libmsi-query.c
@@ -341,7 +341,7 @@ unsigned msi_view_get_row(LibmsiDatabase *db, LibmsiView *view, unsigned row, Li
                 g_object_unref(G_OBJECT(stm));
             }
             else
-                WARN("failed to get stream\n");
+                g_warning("failed to get stream\n");
 
             continue;
         }
diff --git a/libmsi/libmsi-record.c b/libmsi/libmsi-record.c
index 8dbd555..c05eb03 100644
--- a/libmsi/libmsi-record.c
+++ b/libmsi/libmsi-record.c
@@ -476,7 +476,7 @@ static unsigned _libmsi_addstream_from_file(const char *szFile, GsfInput **pstm)
     stm = gsf_input_stdio_new(szFile, NULL);
     if (!stm)
     {
-        WARN("open file failed for %s\n", debugstr_a(szFile));
+        g_warning("open file failed for %s\n", debugstr_a(szFile));
         return LIBMSI_RESULT_OPEN_FAILED;
     }
 
diff --git a/libmsi/libmsi-summary-info.c b/libmsi/libmsi-summary-info.c
index 7782d36..52dd815 100644
--- a/libmsi/libmsi-summary-info.c
+++ b/libmsi/libmsi-summary-info.c
@@ -974,7 +974,7 @@ static unsigned parse_prop( const char *prop, const char *value, unsigned *pid,
         break;
 
     default:
-        WARN("unhandled prop id %u\n", *pid);
+        g_warning("unhandled prop id %u\n", *pid);
         return LIBMSI_RESULT_FUNCTION_FAILED;
     }
 
diff --git a/libmsi/storages.c b/libmsi/storages.c
index 6eb145b..5f8a989 100644
--- a/libmsi/storages.c
+++ b/libmsi/storages.c
@@ -184,7 +184,7 @@ static unsigned storages_view_delete_row(LibmsiView *view, unsigned row)
     name = msi_string_lookup_id(sv->db->strings, sv->storages[row]->str_index);
     if (!name)
     {
-        WARN("failed to retrieve storage name\n");
+        g_warning("failed to retrieve storage name\n");
         return LIBMSI_RESULT_FUNCTION_FAILED;
     }
 
diff --git a/libmsi/streams.c b/libmsi/streams.c
index 09d8bdb..e34fffd 100644
--- a/libmsi/streams.c
+++ b/libmsi/streams.c
@@ -153,7 +153,7 @@ static unsigned streams_view_set_row(LibmsiView *view, unsigned row, LibmsiRecor
         name = strdup(_libmsi_record_get_string_raw(rec, 1));
         if (!name)
         {
-            WARN("failed to retrieve stream name\n");
+            g_warning("failed to retrieve stream name\n");
             goto done;
         }
 
@@ -166,7 +166,7 @@ static unsigned streams_view_set_row(LibmsiView *view, unsigned row, LibmsiRecor
     r = msi_create_stream(sv->db, name, stm);
     if (r != LIBMSI_RESULT_SUCCESS)
     {
-        WARN("failed to create stream: %08x\n", r);
+        g_warning("failed to create stream: %08x\n", r);
         g_object_unref(G_OBJECT(stream->stream));
         msi_free(stream);
         goto done;
@@ -217,7 +217,7 @@ static unsigned streams_view_delete_row(LibmsiView *view, unsigned row)
     name = msi_string_lookup_id(sv->db->strings, sv->streams[row]->str_index);
     if (!name)
     {
-        WARN("failed to retrieve stream name\n");
+        g_warning("failed to retrieve stream name\n");
         return LIBMSI_RESULT_FUNCTION_FAILED;
     }
 
diff --git a/libmsi/string.c b/libmsi/string.c
index 9fdd5ff..29cbe91 100644
--- a/libmsi/string.c
+++ b/libmsi/string.c
@@ -570,13 +570,13 @@ unsigned msi_save_string_table( const string_table *st, LibmsiDatabase *db, unsi
     pool = msi_alloc( poolsize );
     if( ! pool )
     {
-        WARN("Failed to alloc pool %d bytes\n", poolsize );
+        g_warning("Failed to alloc pool %d bytes\n", poolsize );
         goto err;
     }
     data = msi_alloc( datasize );
     if( ! data )
     {
-        WARN("Failed to alloc data %d bytes\n", datasize );
+        g_warning("Failed to alloc data %d bytes\n", datasize );
         goto err;
     }
 
diff --git a/libmsi/table.c b/libmsi/table.c
index ef84bf7..3f7ebbf 100644
--- a/libmsi/table.c
+++ b/libmsi/table.c
@@ -263,13 +263,13 @@ unsigned read_stream_data( GsfInfile *stg, const char *stname,
     msi_free(encname);
     if( !stm )
     {
-        WARN("open stream failed - empty table?\n");
+        TRACE("open stream failed - empty table?\n");
         return ret;
     }
 
     if( gsf_input_size(stm) >> 32 )
     {
-        WARN("Too big!\n");
+        g_warning("Too big!\n");
         goto end;
     }
         
@@ -283,7 +283,7 @@ unsigned read_stream_data( GsfInfile *stg, const char *stname,
         data = g_try_malloc( sz );
         if( !data )
         {
-            WARN("couldn't allocate memory (%u bytes)!\n", sz);
+            g_warning("couldn't allocate memory (%u bytes)!\n", sz);
             ret = LIBMSI_RESULT_NOT_ENOUGH_MEMORY;
             goto end;
         }
@@ -291,7 +291,7 @@ unsigned read_stream_data( GsfInfile *stg, const char *stname,
         if (! gsf_input_read( stm, sz, data ))
         {
             msi_free( data );
-            WARN("read stream failed\n");
+            g_warning("read stream failed\n");
             goto end;
         }
     }
@@ -322,13 +322,13 @@ unsigned write_stream_data( LibmsiDatabase *db, const char *stname,
     msi_free( encname );
     if( !stm )
     {
-        WARN("open stream failed\n");
+        g_warning("open stream failed\n");
         return ret;
     }
 
     if (! gsf_output_write(stm, sz, data) )
     {
-        WARN("Failed to Write\n");
+        g_warning("Failed to Write\n");
         goto end;
     }
 
@@ -395,7 +395,7 @@ static unsigned read_table_from_storage( LibmsiDatabase *db, LibmsiTable *t, Gsf
 
     if( rawsize % row_size )
     {
-        WARN("Table size is invalid %d/%d\n", rawsize, row_size );
+        g_warning("Table size is invalid %d/%d\n", rawsize, row_size );
         goto err;
     }
 
@@ -659,7 +659,7 @@ static unsigned get_tablecolumns( LibmsiDatabase *db, const char *szTableName, L
     r = _libmsi_id_from_string_utf8( db->strings, szTableName, &table_id );
     if (r != LIBMSI_RESULT_SUCCESS)
     {
-        WARN("Couldn't find id for %s\n", debugstr_a(szTableName));
+        g_warning("Couldn't find id for %s\n", debugstr_a(szTableName));
         return r;
     }
     TRACE("Table id is %d, row count is %d\n", table_id, table->row_count);
@@ -727,7 +727,7 @@ unsigned msi_create_table( LibmsiDatabase *db, const char *name, column_info *co
     /* only add tables that don't exist already */
     if( table_view_exists(db, name ) )
     {
-        WARN("table %s exists\n", debugstr_a(name));
+        g_warning("table %s exists\n", debugstr_a(name));
         return LIBMSI_RESULT_BAD_QUERY_SYNTAX;
     }
 
@@ -1573,7 +1573,7 @@ static int compare_record( LibmsiTableView *tv, unsigned row, LibmsiRecord *rec
         r = table_view_fetch_int( &tv->view, row, i + 1, &x );
         if (r != LIBMSI_RESULT_SUCCESS)
         {
-            WARN("table_view_fetch_int should not fail here %u\n", r);
+            g_warning("table_view_fetch_int should not fail here %u\n", r);
             return -1;
         }
         if (ivalue > x)
@@ -1997,7 +1997,7 @@ unsigned table_view_create( LibmsiDatabase *db, const char *name, LibmsiView **v
     if( r != LIBMSI_RESULT_SUCCESS )
     {
         msi_free( tv );
-        WARN("table not found\n");
+        g_warning("table not found\n");
         return r;
     }
 
@@ -2034,14 +2034,14 @@ unsigned _libmsi_database_commit_tables( LibmsiDatabase *db, unsigned bytes_per_
         r = get_table( db, table->name, &t );
         if( r != LIBMSI_RESULT_SUCCESS )
         {
-            WARN("failed to load table %s (r=%08x)\n",
+            g_warning("failed to load table %s (r=%08x)\n",
                   debugstr_a(table->name), r);
             return r;
         }
         r = save_table( db, table, bytes_per_strref );
         if( r != LIBMSI_RESULT_SUCCESS )
         {
-            WARN("failed to save table %s (r=%08x)\n",
+            g_warning("failed to save table %s (r=%08x)\n",
                   debugstr_a(table->name), r);
             return r;
         }
@@ -2490,21 +2490,21 @@ static unsigned msi_table_load_transform( LibmsiDatabase *db, GsfInfile *stg,
                     TRACE("deleting row [%d]:\n", row);
                     r = table_view_delete_row( &tv->view, row );
                     if (r != LIBMSI_RESULT_SUCCESS)
-                        WARN("failed to delete row %u\n", r);
+                        g_warning("failed to delete row %u\n", r);
                 }
                 else if (mask & 1)
                 {
                     TRACE("modifying full row [%d]:\n", row);
                     r = table_view_set_row( &tv->view, row, rec, (1 << tv->num_cols) - 1 );
                     if (r != LIBMSI_RESULT_SUCCESS)
-                        WARN("failed to modify row %u\n", r);
+                        g_warning("failed to modify row %u\n", r);
                 }
                 else
                 {
                     TRACE("modifying masked row [%d]:\n", row);
                     r = table_view_set_row( &tv->view, row, rec, mask );
                     if (r != LIBMSI_RESULT_SUCCESS)
-                        WARN("failed to modify row %u\n", r);
+                        g_warning("failed to modify row %u\n", r);
                 }
             }
             else
@@ -2512,7 +2512,7 @@ static unsigned msi_table_load_transform( LibmsiDatabase *db, GsfInfile *stg,
                 TRACE("inserting row\n");
                 r = table_view_insert_row( &tv->view, rec, -1, false );
                 if (r != LIBMSI_RESULT_SUCCESS)
-                    WARN("failed to insert row %u\n", r);
+                    g_warning("failed to insert row %u\n", r);
             }
 
             if (number != LIBMSI_NULL_INT && !strcmp( name, szColumns ))
diff --git a/libmsi/where.c b/libmsi/where.c
index 9938f35..fde5684 100644
--- a/libmsi/where.c
+++ b/libmsi/where.c
@@ -201,7 +201,7 @@ static unsigned parse_column(LibmsiWhereView *wv, union ext_column *column,
     }
     while ((table = table->next));
 
-    WARN("Couldn't find column %s.%s\n", debugstr_a( column->unparsed.table ), debugstr_a( column->unparsed.column ) );
+    g_warning("Couldn't find column %s.%s\n", debugstr_a( column->unparsed.table ), debugstr_a( column->unparsed.column ) );
     return LIBMSI_RESULT_BAD_QUERY_SYNTAX;
 }
 
@@ -1125,7 +1125,7 @@ unsigned where_view_create( LibmsiDatabase *db, LibmsiView **view, char *tables,
         r = table_view_create(db, tables, &table->view);
         if (r != LIBMSI_RESULT_SUCCESS)
         {
-            WARN("can't create table: %s\n", debugstr_a(tables));
+            g_warning("can't create table: %s\n", debugstr_a(tables));
             msi_free(table);
             r = LIBMSI_RESULT_BAD_QUERY_SYNTAX;
             goto end;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]