From 99336e77ba153c8cf1175951ff2239d6ce422c91 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 23 Oct 2012 11:26:15 +0200 Subject: get rid of the useless Win32 BOOL type --- include/libmsi.h | 3 +- libmsi/alter.c | 6 ++-- libmsi/create.c | 18 +++++----- libmsi/database.c | 28 +++++++-------- libmsi/delete.c | 2 +- libmsi/distinct.c | 2 +- libmsi/insert.c | 22 ++++++------ libmsi/msipriv.h | 32 +++++++++--------- libmsi/msiquery.c | 4 +-- libmsi/query.h | 4 +-- libmsi/record.c | 36 ++++++++++---------- libmsi/select.c | 6 ++-- libmsi/sql-parser.y | 20 +++++------ libmsi/storages.c | 20 +++++------ libmsi/streams.c | 30 ++++++++-------- libmsi/string.c | 18 +++++----- libmsi/suminfo.c | 10 +++--- libmsi/table.c | 74 ++++++++++++++++++++-------------------- libmsi/update.c | 2 +- libmsi/where.c | 30 ++++++++-------- tests/testdatabase.c | 94 +++++++++++++++++++++++++-------------------------- tests/testdatabase.ok | 12 +++---- tests/testrecord.c | 16 ++++----- tests/testrecord.ok | 14 ++++---- 24 files changed, 252 insertions(+), 251 deletions(-) diff --git a/include/libmsi.h b/include/libmsi.h index 16e2488..b6bc739 100644 --- a/include/libmsi.h +++ b/include/libmsi.h @@ -20,6 +20,7 @@ #define _LIBMSI_H #include +#include struct tagMSIOBJECT; typedef struct tagMSIOBJECT MSIOBJECT; @@ -175,7 +176,7 @@ unsigned MsiRecordGetStringW(MSIOBJECT *,unsigned,WCHAR *,unsigned *); unsigned MsiRecordGetFieldCount(MSIOBJECT *); int MsiRecordGetInteger(MSIOBJECT *,unsigned); unsigned MsiRecordDataSize(MSIOBJECT *,unsigned); -BOOL MsiRecordIsNull(MSIOBJECT *,unsigned); +bool MsiRecordIsNull(MSIOBJECT *,unsigned); unsigned MsiFormatRecordA(MSIOBJECT *,MSIOBJECT *,char *,unsigned *); unsigned MsiFormatRecordW(MSIOBJECT *,MSIOBJECT *,WCHAR *,unsigned *); #define MsiFormatRecord WINELIB_NAME_AW(MsiFormatRecord) diff --git a/libmsi/alter.c b/libmsi/alter.c index e139bcc..9b12bbc 100644 --- a/libmsi/alter.c +++ b/libmsi/alter.c @@ -74,7 +74,7 @@ static unsigned ITERATE_columns(MSIRECORD *row, void *param) return ERROR_SUCCESS; } -static BOOL check_column_exists(MSIDATABASE *db, const WCHAR *table, const WCHAR *column) +static bool check_column_exists(MSIDATABASE *db, const WCHAR *table, const WCHAR *column) { MSIQUERY *view; MSIRECORD *rec; @@ -89,7 +89,7 @@ static BOOL check_column_exists(MSIDATABASE *db, const WCHAR *table, const WCHAR r = MSI_OpenQuery(db, &view, query, table, column); if (r != ERROR_SUCCESS) - return FALSE; + return false; r = MSI_ViewExecute(view, NULL); if (r != ERROR_SUCCESS) @@ -188,7 +188,7 @@ static unsigned ALTER_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *c } static unsigned ALTER_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; diff --git a/libmsi/create.c b/libmsi/create.c index b35ea26..3027348 100644 --- a/libmsi/create.c +++ b/libmsi/create.c @@ -42,8 +42,8 @@ typedef struct tagMSICREATEVIEW MSIVIEW view; MSIDATABASE *db; const WCHAR * name; - BOOL bIsTemp; - BOOL hold; + bool bIsTemp; + bool hold; column_info *col_info; } MSICREATEVIEW; @@ -59,7 +59,7 @@ static unsigned CREATE_fetch_int( MSIVIEW *view, unsigned row, unsigned col, uns static unsigned CREATE_execute( MSIVIEW *view, MSIRECORD *record ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; - BOOL persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE; + bool persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE; TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name), cv->bIsTemp?"temporary":"permanent"); @@ -89,7 +89,7 @@ static unsigned CREATE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned * } static unsigned CREATE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -157,13 +157,13 @@ static unsigned check_columns( const column_info *col_info ) } unsigned CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, - column_info *col_info, BOOL hold ) + column_info *col_info, bool hold ) { MSICREATEVIEW *cv = NULL; unsigned r; column_info *col; - BOOL temp = TRUE; - BOOL tempprim = FALSE; + bool temp = true; + bool tempprim = false; TRACE("%p\n", cv ); @@ -181,9 +181,9 @@ unsigned CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, col->table = table; if( !col->temporary ) - temp = FALSE; + temp = false; else if ( col->type & MSITYPE_KEY ) - tempprim = TRUE; + tempprim = true; } if ( !temp && tempprim ) diff --git a/libmsi/database.c b/libmsi/database.c index e51a081..1ad7e8d 100644 --- a/libmsi/database.c +++ b/libmsi/database.c @@ -269,7 +269,7 @@ static HRESULT db_initialize( IStorage *stg, const GUID *clsid ) } /* create the _Tables stream */ - hr = write_stream_data( stg, szTables, NULL, 0, TRUE ); + hr = write_stream_data( stg, szTables, NULL, 0, true ); if (FAILED( hr )) { WARN("failed to create _Tables stream 0x%08x\n", hr); @@ -302,7 +302,7 @@ unsigned MSI_OpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIDAT const WCHAR *szMode; const WCHAR *save_path; STATSTG stat; - BOOL created = FALSE, patch = FALSE; + bool created = false, patch = false; WCHAR path[MAX_PATH]; TRACE("%s %s\n",debugstr_w(szDBPath),debugstr_w(szPersist) ); @@ -315,19 +315,19 @@ unsigned MSI_OpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIDAT { TRACE("Database is a patch\n"); szPersist -= MSIDBOPEN_PATCHFILE; - patch = TRUE; + patch = true; } save_path = szDBPath; szMode = szPersist; if( !IS_INTMSIDBOPEN(szPersist) ) { - if (!CopyFileW( szDBPath, szPersist, FALSE )) + if (!CopyFileW( szDBPath, szPersist, false )) return ERROR_OPEN_FAILED; szDBPath = szPersist; szPersist = MSIDBOPEN_TRANSACT; - created = TRUE; + created = true; } if( szPersist == MSIDBOPEN_READONLY ) @@ -342,7 +342,7 @@ unsigned MSI_OpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIDAT if( SUCCEEDED(r) ) r = db_initialize( stg, patch ? &CLSID_MsiPatch : &CLSID_MsiDatabase ); - created = TRUE; + created = true; } else if( szPersist == MSIDBOPEN_CREATEDIRECT ) { @@ -351,7 +351,7 @@ unsigned MSI_OpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIDAT if( SUCCEEDED(r) ) r = db_initialize( stg, patch ? &CLSID_MsiPatch : &CLSID_MsiDatabase ); - created = TRUE; + created = true; } else if( szPersist == MSIDBOPEN_TRANSACT ) { @@ -1338,15 +1338,15 @@ typedef struct _tagMERGEDATA struct list *tabledata; } MERGEDATA; -static BOOL merge_type_match(const WCHAR *type1, const WCHAR *type2) +static bool merge_type_match(const WCHAR *type1, const WCHAR *type2) { if (((type1[0] == 'l') || (type1[0] == 's')) && ((type2[0] == 'l') || (type2[0] == 's'))) - return TRUE; + return true; if (((type1[0] == 'L') || (type1[0] == 'S')) && ((type2[0] == 'L') || (type2[0] == 'S'))) - return TRUE; + return true; return !strcmpW( type1, type2 ); } @@ -1910,7 +1910,7 @@ static unsigned merge_table(MSIDATABASE *db, MERGETABLE *table) if (r != ERROR_SUCCESS) return r; - r = tv->ops->insert_row(tv, row->data, -1, FALSE); + r = tv->ops->insert_row(tv, row->data, -1, false); tv->ops->delete(tv); if (r != ERROR_SUCCESS) @@ -1969,7 +1969,7 @@ unsigned MsiDatabaseMergeW(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, struct list *item, *cursor; MSIDATABASE *db, *merge; MERGETABLE *table; - BOOL conflicts; + bool conflicts; unsigned r; TRACE("(%d, %d, %s)\n", hDatabase, hDatabaseMerge, @@ -1990,12 +1990,12 @@ unsigned MsiDatabaseMergeW(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, if (r != ERROR_SUCCESS) goto done; - conflicts = FALSE; + conflicts = false; LIST_FOR_EACH_ENTRY(table, &tabledata, MERGETABLE, entry) { if (table->numconflicts) { - conflicts = TRUE; + conflicts = true; r = update_merge_errors(db, szTableName, table->name, table->numconflicts); diff --git a/libmsi/delete.c b/libmsi/delete.c index f7b352c..b601bb1 100644 --- a/libmsi/delete.c +++ b/libmsi/delete.c @@ -125,7 +125,7 @@ static unsigned DELETE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned * } static unsigned DELETE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; diff --git a/libmsi/distinct.c b/libmsi/distinct.c index 3439855..324b390 100644 --- a/libmsi/distinct.c +++ b/libmsi/distinct.c @@ -203,7 +203,7 @@ static unsigned DISTINCT_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned } static unsigned DISTINCT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; diff --git a/libmsi/insert.c b/libmsi/insert.c index 27a78ef..9725d04 100644 --- a/libmsi/insert.c +++ b/libmsi/insert.c @@ -42,7 +42,7 @@ typedef struct tagMSIINSERTVIEW MSIVIEW view; MSIVIEW *table; MSIDATABASE *db; - BOOL bIsTemp; + bool bIsTemp; MSIVIEW *sv; column_info *vals; } MSIINSERTVIEW; @@ -105,7 +105,7 @@ err: /* checks to see if the column order specified in the INSERT query * matches the column order of the table */ -static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, unsigned col_count) +static bool msi_columns_in_order(MSIINSERTVIEW *iv, unsigned col_count) { const WCHAR *a; const WCHAR *b; @@ -116,9 +116,9 @@ static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, unsigned col_count) iv->sv->ops->get_column_info(iv->sv, i, &a, NULL, NULL, NULL); iv->table->ops->get_column_info(iv->table, i, &b, NULL, NULL, NULL); - if (strcmpW( a, b )) return FALSE; + if (strcmpW( a, b )) return false; } - return TRUE; + return true; } /* rearranges the data in the record to be inserted based on column order, @@ -177,29 +177,29 @@ err: return r; } -static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row) +static bool row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row) { unsigned r, i, col_count, type; r = iv->table->ops->get_dimensions( iv->table, NULL, &col_count ); if (r != ERROR_SUCCESS) - return FALSE; + return false; for (i = 1; i <= col_count; i++) { r = iv->table->ops->get_column_info(iv->table, i, NULL, &type, NULL, NULL); if (r != ERROR_SUCCESS) - return FALSE; + return false; if (!(type & MSITYPE_KEY)) continue; if (MSI_RecordIsNull(row, i)) - return TRUE; + return true; } - return FALSE; + return false; } static unsigned INSERT_execute( MSIVIEW *view, MSIRECORD *record ) @@ -279,7 +279,7 @@ static unsigned INSERT_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned * } static unsigned INSERT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; MSIVIEW *sv; @@ -359,7 +359,7 @@ static unsigned count_column_info( const column_info *ci ) } unsigned INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, - column_info *columns, column_info *values, BOOL temp ) + column_info *columns, column_info *values, bool temp ) { MSIINSERTVIEW *iv = NULL; unsigned r; diff --git a/libmsi/msipriv.h b/libmsi/msipriv.h index 511dd96..3260419 100644 --- a/libmsi/msipriv.h +++ b/libmsi/msipriv.h @@ -123,7 +123,7 @@ typedef struct _column_info const WCHAR *table; const WCHAR *column; int type; - BOOL temporary; + bool temporary; struct expr *val; struct _column_info *next; } column_info; @@ -167,7 +167,7 @@ typedef struct tagMSIVIEWOPS /* * Inserts a new row into the database from the records contents */ - unsigned (*insert_row)( MSIVIEW *view, MSIRECORD *record, unsigned row, BOOL temporary ); + unsigned (*insert_row)( MSIVIEW *view, MSIRECORD *record, unsigned row, bool temporary ); /* * Deletes a row from the database @@ -198,7 +198,7 @@ typedef struct tagMSIVIEWOPS * The column information can be queried at any time. */ unsigned (*get_column_info)( MSIVIEW *view, unsigned n, const WCHAR **name, unsigned *type, - BOOL *temporary, const WCHAR **table_name ); + bool *temporary, const WCHAR **table_name ); /* * modify - not yet implemented properly @@ -236,7 +236,7 @@ typedef struct tagMSIVIEWOPS /* * add_column - adds a column to the table */ - unsigned (*add_column)( MSIVIEW *view, const WCHAR *table, unsigned number, const WCHAR *column, unsigned type, BOOL hold ); + unsigned (*add_column)( MSIVIEW *view, const WCHAR *table, unsigned number, const WCHAR *column, unsigned type, bool hold ); /* * remove_column - removes the column represented by table name and column number from the table @@ -282,7 +282,7 @@ typedef struct tagMSISUMMARYINFO /* handle unicode/ascii output in the Msi* API functions */ typedef struct { - BOOL unicode; + bool unicode; union { char *a; WCHAR *w; @@ -290,7 +290,7 @@ typedef struct { } awstring; typedef struct { - BOOL unicode; + bool unicode; union { const char *a; const WCHAR *w; @@ -321,7 +321,7 @@ enum StringPersistence StringNonPersistent = 1 }; -extern BOOL msi_addstringW( string_table *st, const WCHAR *data, int len, uint16_t refcount, enum StringPersistence persistence ); +extern int msi_addstringW( string_table *st, const WCHAR *data, int len, uint16_t refcount, enum StringPersistence persistence ); extern unsigned msi_string2idW( const string_table *st, const WCHAR *buffer, unsigned *id ); extern VOID msi_destroy_stringtable( string_table *st ); extern const WCHAR *msi_string_lookup_id( const string_table *st, unsigned id ); @@ -331,13 +331,13 @@ extern unsigned msi_save_string_table( const string_table *st, IStorage *storage extern unsigned msi_get_string_table_codepage( const string_table *st ); extern unsigned msi_set_string_table_codepage( string_table *st, unsigned codepage ); -extern BOOL TABLE_Exists( MSIDATABASE *db, const WCHAR *name ); +extern bool TABLE_Exists( MSIDATABASE *db, const WCHAR *name ); extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, const WCHAR *table ); -extern unsigned read_stream_data( IStorage *stg, const WCHAR *stname, BOOL table, +extern unsigned read_stream_data( IStorage *stg, const WCHAR *stname, bool table, uint8_t **pdata, unsigned *psz ); extern unsigned write_stream_data( IStorage *stg, const WCHAR *stname, - const void *data, unsigned sz, BOOL bTable ); + const void *data, unsigned sz, bool bTable ); /* transform functions */ extern unsigned msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ); @@ -354,7 +354,7 @@ extern MSIRECORD *MSI_CreateRecord( unsigned ); extern unsigned MSI_RecordSetInteger( MSIRECORD *, unsigned, int ); extern unsigned MSI_RecordSetIntPtr( MSIRECORD *, unsigned, intptr_t ); extern unsigned MSI_RecordSetStringW( MSIRECORD *, unsigned, const WCHAR *); -extern BOOL MSI_RecordIsNull( MSIRECORD *, unsigned ); +extern bool MSI_RecordIsNull( MSIRECORD *, unsigned ); extern unsigned MSI_RecordGetStringW( MSIRECORD *, unsigned, WCHAR *, unsigned *); extern unsigned MSI_RecordGetStringA( MSIRECORD *, unsigned, char *, unsigned *); extern int MSI_RecordGetInteger( MSIRECORD *, unsigned ); @@ -366,13 +366,13 @@ extern unsigned MSI_RecordStreamToFile( MSIRECORD *, unsigned, const WCHAR *); extern unsigned MSI_RecordSetStreamFromFileW( MSIRECORD *, unsigned, const WCHAR *); extern unsigned MSI_RecordCopyField( MSIRECORD *, unsigned, MSIRECORD *, unsigned ); extern MSIRECORD *MSI_CloneRecord( MSIRECORD * ); -extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ); -extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field); +extern bool MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ); +extern bool MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field); /* stream internals */ extern void enum_stream_names( IStorage *stg ); -extern WCHAR *encode_streamname(BOOL bTable, const WCHAR *in); -extern BOOL decode_streamname(const WCHAR *in, WCHAR *out); +extern WCHAR *encode_streamname(bool bTable, const WCHAR *in); +extern bool decode_streamname(const WCHAR *in, WCHAR *out); /* database internals */ extern unsigned msi_get_raw_stream( MSIDATABASE *, const WCHAR *, IStream **); @@ -542,7 +542,7 @@ static inline void *msi_realloc_zero( void *mem, size_t len ) return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len ); } -static inline BOOL msi_free( void *mem ) +static inline bool msi_free( void *mem ) { return HeapFree( GetProcessHeap(), 0, mem ); } diff --git a/libmsi/msiquery.c b/libmsi/msiquery.c index be9428b..8d6ebd2 100644 --- a/libmsi/msiquery.c +++ b/libmsi/msiquery.c @@ -461,7 +461,7 @@ out: } static unsigned msi_set_record_type_string( MSIRECORD *rec, unsigned field, - unsigned type, BOOL temporary ) + unsigned type, bool temporary ) { static const WCHAR fmt[] = { '%','d',0 }; WCHAR szType[0x10]; @@ -503,7 +503,7 @@ unsigned MSI_ViewGetColumnInfo( MSIQUERY *query, MSICOLINFO info, MSIRECORD **pr MSIRECORD *rec; MSIVIEW *view = query->view; const WCHAR *name; - BOOL temporary; + bool temporary; if( !view ) return ERROR_FUNCTION_FAILED; diff --git a/libmsi/query.h b/libmsi/query.h index 0df6c41..8a58a8a 100644 --- a/libmsi/query.h +++ b/libmsi/query.h @@ -114,10 +114,10 @@ unsigned WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *tables, struct expr *cond ); unsigned CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, - column_info *col_info, BOOL hold ); + column_info *col_info, bool hold ); unsigned INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, - column_info *columns, column_info *values, BOOL temp ); + column_info *columns, column_info *values, bool temp ); unsigned UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *table, column_info *list, struct expr *expr ); diff --git a/libmsi/record.c b/libmsi/record.c index 66cfb8f..79bf373 100644 --- a/libmsi/record.c +++ b/libmsi/record.c @@ -123,7 +123,7 @@ unsigned MsiRecordGetFieldCount( MSIOBJECT *handle ) return ret; } -static BOOL string2intW( const WCHAR *str, int *out ) +static bool string2intW( const WCHAR *str, int *out ) { int x = 0; const WCHAR *p = str; @@ -133,7 +133,7 @@ static BOOL string2intW( const WCHAR *str, int *out ) while ( *p ) { if( (*p < '0') || (*p > '9') ) - return FALSE; + return false; x *= 10; x += (*p - '0'); p++; @@ -143,7 +143,7 @@ static BOOL string2intW( const WCHAR *str, int *out ) x = -x; *out = x; - return TRUE; + return true; } unsigned MSI_RecordCopyField( MSIRECORD *in_rec, unsigned in_n, @@ -337,9 +337,9 @@ unsigned MsiRecordSetInteger( MSIOBJECT *handle, unsigned iField, int iVal ) return ret; } -BOOL MSI_RecordIsNull( MSIRECORD *rec, unsigned iField ) +bool MSI_RecordIsNull( MSIRECORD *rec, unsigned iField ) { - BOOL r = TRUE; + bool r = true; TRACE("%p %d\n", rec, iField ); @@ -349,7 +349,7 @@ BOOL MSI_RecordIsNull( MSIRECORD *rec, unsigned iField ) return r; } -BOOL MsiRecordIsNull( MSIOBJECT *handle, unsigned iField ) +bool MsiRecordIsNull( MSIOBJECT *handle, unsigned iField ) { MSIRECORD *rec; unsigned ret; @@ -671,7 +671,7 @@ static unsigned RECORD_StreamFromFile(const WCHAR *szFile, IStream **pstm) hGlob = GlobalAlloc(GMEM_FIXED, sz); if( hGlob ) { - BOOL r = ReadFile(handle, hGlob, sz, &read, NULL); + bool r = ReadFile(handle, hGlob, sz, &read, NULL); if( !r ) { GlobalFree(hGlob); @@ -684,7 +684,7 @@ static unsigned RECORD_StreamFromFile(const WCHAR *szFile, IStream **pstm) return ERROR_FUNCTION_FAILED; /* make a stream out of it, and set the correct file size */ - hr = CreateStreamOnHGlobal(hGlob, TRUE, pstm); + hr = CreateStreamOnHGlobal(hGlob, true, pstm); if( FAILED( hr ) ) { GlobalFree(hGlob); @@ -985,10 +985,10 @@ MSIRECORD *MSI_CloneRecord(MSIRECORD *rec) return clone; } -BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field) +bool MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field) { if (a->fields[field].type != b->fields[field].type) - return FALSE; + return false; switch (a->fields[field].type) { @@ -997,36 +997,36 @@ BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field) case MSIFIELD_INT: if (a->fields[field].u.iVal != b->fields[field].u.iVal) - return FALSE; + return false; break; case MSIFIELD_WSTR: if (strcmpW(a->fields[field].u.szwVal, b->fields[field].u.szwVal)) - return FALSE; + return false; break; case MSIFIELD_STREAM: default: - return FALSE; + return false; } - return TRUE; + return true; } -BOOL MSI_RecordsAreEqual(MSIRECORD *a, MSIRECORD *b) +bool MSI_RecordsAreEqual(MSIRECORD *a, MSIRECORD *b) { unsigned i; if (a->count != b->count) - return FALSE; + return false; for (i = 0; i <= a->count; i++) { if (!MSI_RecordsAreFieldsEqual( a, b, i )) - return FALSE; + return false; } - return TRUE; + return true; } WCHAR *msi_dup_record_field( MSIRECORD *rec, int field ) diff --git a/libmsi/select.c b/libmsi/select.c index 794172f..9d48172 100644 --- a/libmsi/select.c +++ b/libmsi/select.c @@ -142,7 +142,7 @@ static unsigned SELECT_set_row( MSIVIEW *view, unsigned row, MSIRECORD *rec, uns return r; } -static unsigned SELECT_insert_row( MSIVIEW *view, MSIRECORD *record, unsigned row, BOOL temporary ) +static unsigned SELECT_insert_row( MSIVIEW *view, MSIRECORD *record, unsigned row, bool temporary ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; unsigned i, table_cols, r; @@ -215,7 +215,7 @@ static unsigned SELECT_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned * } static unsigned SELECT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -232,7 +232,7 @@ static unsigned SELECT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR * { if (name) *name = szEmpty; if (type) *type = MSITYPE_UNKNOWN | MSITYPE_VALID; - if (temporary) *temporary = FALSE; + if (temporary) *temporary = false; if (table_name) *table_name = szEmpty; return ERROR_SUCCESS; } diff --git a/libmsi/sql-parser.y b/libmsi/sql-parser.y index 888c5b6..b94f122 100644 --- a/libmsi/sql-parser.y +++ b/libmsi/sql-parser.y @@ -61,7 +61,7 @@ static WCHAR *parser_add_table( void *info, const WCHAR *list, const WCHAR *tabl static void *parser_alloc( void *info, unsigned int sz ); static column_info *parser_alloc_column( void *info, const WCHAR *table, const WCHAR *column ); -static BOOL SQL_MarkPrimaryKeys( column_info **cols, column_info *keys); +static bool SQL_MarkPrimaryKeys( column_info **cols, column_info *keys); static struct expr * EXPR_complex( void *info, struct expr *l, unsigned op, struct expr *r ); static struct expr * EXPR_unary( void *info, struct expr *l, unsigned op ); @@ -152,7 +152,7 @@ oneinsert: SQL_input *sql = (SQL_input*) info; MSIVIEW *insert = NULL; - INSERT_CreateView( sql->db, &insert, $3, $5, $9, FALSE ); + INSERT_CreateView( sql->db, &insert, $3, $5, $9, false ); if( !insert ) YYABORT; @@ -163,7 +163,7 @@ oneinsert: SQL_input *sql = (SQL_input*) info; MSIVIEW *insert = NULL; - INSERT_CreateView( sql->db, &insert, $3, $5, $9, TRUE ); + INSERT_CreateView( sql->db, &insert, $3, $5, $9, true ); if( !insert ) YYABORT; @@ -180,7 +180,7 @@ onecreate: if( !$5 ) YYABORT; - r = CREATE_CreateView( sql->db, &create, $3, $5, FALSE ); + r = CREATE_CreateView( sql->db, &create, $3, $5, false ); if( !create ) { sql->r = r; @@ -196,7 +196,7 @@ onecreate: if( !$5 ) YYABORT; - CREATE_CreateView( sql->db, &create, $3, $5, TRUE ); + CREATE_CreateView( sql->db, &create, $3, $5, true ); if( !create ) YYABORT; @@ -337,7 +337,7 @@ column_and_type: { $$ = $1; $$->type = ($2 | MSITYPE_VALID); - $$->temporary = $2 & MSITYPE_TEMPORARY ? TRUE : FALSE; + $$->temporary = $2 & MSITYPE_TEMPORARY ? true : false; } ; @@ -971,11 +971,11 @@ static void swap_columns( column_info **cols, column_info *A, int idx ) *cols = A; } -static BOOL SQL_MarkPrimaryKeys( column_info **cols, +static bool SQL_MarkPrimaryKeys( column_info **cols, column_info *keys ) { column_info *k; - BOOL found = TRUE; + bool found = true; int count; for( k = keys, count = 0; k && found; k = k->next, count++ ) @@ -983,13 +983,13 @@ static BOOL SQL_MarkPrimaryKeys( column_info **cols, column_info *c; int idx; - found = FALSE; + found = false; for( c = *cols, idx = 0; c && !found; c = c->next, idx++ ) { if( strcmpW( k->column, c->column ) ) continue; c->type |= MSITYPE_KEY; - found = TRUE; + found = true; if (idx != count) swap_columns( cols, c, count ); } diff --git a/libmsi/storages.c b/libmsi/storages.c index dae1a52..4529a8d 100644 --- a/libmsi/storages.c +++ b/libmsi/storages.c @@ -53,17 +53,17 @@ typedef struct tagMSISTORAGESVIEW unsigned row_size; } MSISTORAGESVIEW; -static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, unsigned size) +static bool storages_set_table_size(MSISTORAGESVIEW *sv, unsigned size) { if (size >= sv->max_storages) { sv->max_storages *= 2; sv->storages = msi_realloc(sv->storages, sv->max_storages * sizeof(STORAGE *)); if (!sv->storages) - return FALSE; + return false; } - return TRUE; + return true; } static STORAGE *create_storage(MSISTORAGESVIEW *sv, const WCHAR *name, IStorage *stg) @@ -149,7 +149,7 @@ static HRESULT stream_to_storage(IStream *stm, IStorage **stg) if (FAILED(hr) || read != size) goto done; - hr = CreateILockBytesOnHGlobal(NULL, TRUE, &lockbytes); + hr = CreateILockBytesOnHGlobal(NULL, true, &lockbytes); if (FAILED(hr)) goto done; @@ -232,7 +232,7 @@ done: return r; } -static unsigned STORAGES_insert_row(MSIVIEW *view, MSIRECORD *rec, unsigned row, BOOL temporary) +static unsigned STORAGES_insert_row(MSIVIEW *view, MSIRECORD *rec, unsigned row, bool temporary) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -278,7 +278,7 @@ static unsigned STORAGES_get_dimensions(MSIVIEW *view, unsigned *rows, unsigned } static unsigned STORAGES_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name); @@ -299,7 +299,7 @@ static unsigned STORAGES_get_column_info( MSIVIEW *view, unsigned n, const WCHAR break; } if (table_name) *table_name = szStorages; - if (temporary) *temporary = FALSE; + if (temporary) *temporary = false; return ERROR_SUCCESS; } @@ -348,7 +348,7 @@ static unsigned storages_modify_assign(MSIVIEW *view, MSIRECORD *rec) if (r == ERROR_SUCCESS) return storages_modify_update(view, rec); - return STORAGES_insert_row(view, rec, -1, FALSE); + return STORAGES_insert_row(view, rec, -1, false); } static unsigned STORAGES_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, unsigned row) @@ -364,7 +364,7 @@ static unsigned STORAGES_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD break; case MSIMODIFY_INSERT: - r = STORAGES_insert_row(view, rec, -1, FALSE); + r = STORAGES_insert_row(view, rec, -1, false); break; case MSIMODIFY_UPDATE: @@ -481,7 +481,7 @@ static int add_storages_to_table(MSISTORAGESVIEW *sv) if (!sv->storages) return -1; - while (TRUE) + while (true) { size = 0; hr = IEnumSTATSTG_Next(stgenum, 1, &stat, &size); diff --git a/libmsi/streams.c b/libmsi/streams.c index 9d2721b..74e86f9 100644 --- a/libmsi/streams.c +++ b/libmsi/streams.c @@ -52,20 +52,20 @@ typedef struct tagMSISTREAMSVIEW unsigned row_size; } MSISTREAMSVIEW; -static BOOL streams_set_table_size(MSISTREAMSVIEW *sv, unsigned size) +static bool streams_set_table_size(MSISTREAMSVIEW *sv, unsigned size) { if (size >= sv->max_streams) { sv->max_streams *= 2; sv->streams = msi_realloc_zero(sv->streams, sv->max_streams * sizeof(STREAM *)); if (!sv->streams) - return FALSE; + return false; } - return TRUE; + return true; } -static STREAM *create_stream(MSISTREAMSVIEW *sv, const WCHAR *name, BOOL encoded, IStream *stm) +static STREAM *create_stream(MSISTREAMSVIEW *sv, const WCHAR *name, bool encoded, IStream *stm) { STREAM *stream; WCHAR decoded[MAX_STREAM_NAME_LEN]; @@ -180,17 +180,17 @@ static unsigned STREAMS_set_row(MSIVIEW *view, unsigned row, MSIRECORD *rec, uns goto done; } - encname = encode_streamname(FALSE, name); + encname = encode_streamname(false, name); msi_destroy_stream(sv->db, encname); - r = write_stream_data(sv->db->storage, name, data, count, FALSE); + r = write_stream_data(sv->db->storage, name, data, count, false); if (r != ERROR_SUCCESS) { WARN("failed to write stream data: %d\n", r); goto done; } - stream = create_stream(sv, name, FALSE, NULL); + stream = create_stream(sv, name, false, NULL); if (!stream) goto done; @@ -214,7 +214,7 @@ done: return r; } -static unsigned STREAMS_insert_row(MSIVIEW *view, MSIRECORD *rec, unsigned row, BOOL temporary) +static unsigned STREAMS_insert_row(MSIVIEW *view, MSIRECORD *rec, unsigned row, bool temporary) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; unsigned i; @@ -267,7 +267,7 @@ static unsigned STREAMS_get_dimensions(MSIVIEW *view, unsigned *rows, unsigned * } static unsigned STREAMS_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name); @@ -288,7 +288,7 @@ static unsigned STREAMS_get_column_info( MSIVIEW *view, unsigned n, const WCHAR break; } if (table_name) *table_name = szStreams; - if (temporary) *temporary = FALSE; + if (temporary) *temporary = false; return ERROR_SUCCESS; } @@ -337,7 +337,7 @@ static unsigned streams_modify_assign(MSIVIEW *view, MSIRECORD *rec) if (r == ERROR_SUCCESS) return streams_modify_update(view, rec); - return STREAMS_insert_row(view, rec, -1, FALSE); + return STREAMS_insert_row(view, rec, -1, false); } static unsigned STREAMS_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, unsigned row) @@ -353,7 +353,7 @@ static unsigned STREAMS_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD * break; case MSIMODIFY_INSERT: - r = STREAMS_insert_row(view, rec, -1, FALSE); + r = STREAMS_insert_row(view, rec, -1, false); break; case MSIMODIFY_UPDATE: @@ -474,7 +474,7 @@ static int add_streams_to_table(MSISTREAMSVIEW *sv) if (!sv->streams) return -1; - while (TRUE) + while (true) { size = 0; hr = IEnumSTATSTG_Next(stgenum, 1, &stat, &size); @@ -494,7 +494,7 @@ static int add_streams_to_table(MSISTREAMSVIEW *sv) continue; } - stream = create_stream(sv, stat.pwcsName, TRUE, NULL); + stream = create_stream(sv, stat.pwcsName, true, NULL); if (!stream) { count = -1; @@ -509,7 +509,7 @@ static int add_streams_to_table(MSISTREAMSVIEW *sv) } else { - encname = encode_streamname(FALSE, stat.pwcsName); + encname = encode_streamname(false, stat.pwcsName); r = msi_get_raw_stream(sv->db, encname, &stream->stream); msi_free(encname); } diff --git a/libmsi/string.c b/libmsi/string.c index 875fcee..39071e4 100644 --- a/libmsi/string.c +++ b/libmsi/string.c @@ -56,14 +56,14 @@ struct string_table unsigned *sorted; /* index */ }; -static BOOL validate_codepage( unsigned codepage ) +static bool validate_codepage( unsigned codepage ) { if (codepage != CP_ACP && !IsValidCodePage( codepage )) { WARN("invalid codepage %u\n", codepage); - return FALSE; + return false; } - return TRUE; + return true; } static string_table *init_stringtable( int entries, unsigned codepage ) @@ -451,12 +451,12 @@ HRESULT msi_init_string_table( IStorage *stg ) unsigned ret; /* create the StringPool stream... add the zero string to it*/ - ret = write_stream_data(stg, szStringPool, zero, sizeof zero, TRUE); + ret = write_stream_data(stg, szStringPool, zero, sizeof zero, true); if (ret != ERROR_SUCCESS) return E_FAIL; /* create the StringData stream... make it zero length */ - ret = write_stream_data(stg, szStringData, NULL, 0, TRUE); + ret = write_stream_data(stg, szStringData, NULL, 0, true); if (ret != ERROR_SUCCESS) return E_FAIL; @@ -471,10 +471,10 @@ string_table *msi_load_string_table( IStorage *stg, unsigned *bytes_per_strref ) unsigned r, datasize = 0, poolsize = 0, codepage; unsigned i, count, offset, len, n, refs; - r = read_stream_data( stg, szStringPool, TRUE, (uint8_t **)&pool, &poolsize ); + r = read_stream_data( stg, szStringPool, true, (uint8_t **)&pool, &poolsize ); if( r != ERROR_SUCCESS) goto end; - r = read_stream_data( stg, szStringData, TRUE, (uint8_t **)&data, &datasize ); + r = read_stream_data( stg, szStringData, true, (uint8_t **)&data, &datasize ); if( r != ERROR_SUCCESS) goto end; @@ -638,11 +638,11 @@ unsigned msi_save_string_table( const string_table *st, IStorage *storage, unsig } /* write the streams */ - r = write_stream_data( storage, szStringData, data, datasize, TRUE ); + r = write_stream_data( storage, szStringData, data, datasize, true ); TRACE("Wrote StringData r=%08x\n", r); if( r ) goto err; - r = write_stream_data( storage, szStringPool, pool, poolsize, TRUE ); + r = write_stream_data( storage, szStringPool, pool, poolsize, true ); TRACE("Wrote StringPool r=%08x\n", r); if( r ) goto err; diff --git a/libmsi/suminfo.c b/libmsi/suminfo.c index 8d4bdcd..de28865 100644 --- a/libmsi/suminfo.c +++ b/libmsi/suminfo.c @@ -654,7 +654,7 @@ unsigned MsiSummaryInfoGetPropertyA( TRACE("%d %d %p %p %p %p %p\n", handle, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf ); - str.unicode = FALSE; + str.unicode = false; str.str.a = szValueBuf; return get_prop( handle, uiProperty, puiDataType, piValue, @@ -670,7 +670,7 @@ unsigned MsiSummaryInfoGetPropertyW( TRACE("%d %d %p %p %p %p %p\n", handle, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf ); - str.unicode = TRUE; + str.unicode = true; str.str.w = szValueBuf; return get_prop( handle, uiProperty, puiDataType, piValue, @@ -756,7 +756,7 @@ unsigned MsiSummaryInfoSetPropertyW( MSIOBJECT *handle, unsigned uiProperty, if( !si ) return ERROR_INVALID_HANDLE; - str.unicode = TRUE; + str.unicode = true; str.str.w = szValue; ret = set_prop( si, uiProperty, type, iValue, pftValue, &str ); @@ -788,7 +788,7 @@ unsigned MsiSummaryInfoSetPropertyA( MSIOBJECT *handle, unsigned uiProperty, if( !si ) return ERROR_INVALID_HANDLE; - str.unicode = FALSE; + str.unicode = false; str.str.a = szValue; ret = set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); @@ -883,7 +883,7 @@ static unsigned parse_prop( const WCHAR *prop, const WCHAR *value, unsigned *pid case MSI_PID_APPNAME: case MSI_PID_TITLE: str_value->str.w = value; - str_value->unicode = TRUE; + str_value->unicode = true; break; default: diff --git a/libmsi/table.c b/libmsi/table.c index 544bfa1..c12d969 100644 --- a/libmsi/table.c +++ b/libmsi/table.c @@ -56,14 +56,14 @@ typedef struct tagMSICOLUMNINFO unsigned type; unsigned offset; int ref_count; - BOOL temporary; + bool temporary; MSICOLUMNHASHENTRY **hash_table; } MSICOLUMNINFO; struct tagMSITABLE { uint8_t **data; - BOOL *data_persistent; + bool *data_persistent; unsigned row_count; struct list entry; MSICOLUMNINFO *colinfo; @@ -125,7 +125,7 @@ static int utf2mime(int x) return -1; } -WCHAR *encode_streamname(BOOL bTable, const WCHAR *in) +WCHAR *encode_streamname(bool bTable, const WCHAR *in) { unsigned count = MAX_STREAM_NAME; unsigned ch, next; @@ -185,7 +185,7 @@ static int mime2utf(int x) return '_'; } -BOOL decode_streamname(const WCHAR *in, WCHAR *out) +bool decode_streamname(const WCHAR *in, WCHAR *out) { WCHAR ch; unsigned count = 0; @@ -240,7 +240,7 @@ void enum_stream_names( IStorage *stg ) IEnumSTATSTG_Release( stgenum ); } -unsigned read_stream_data( IStorage *stg, const WCHAR *stname, BOOL table, +unsigned read_stream_data( IStorage *stg, const WCHAR *stname, bool table, uint8_t **pdata, unsigned *psz ) { HRESULT r; @@ -305,7 +305,7 @@ end: } unsigned write_stream_data( IStorage *stg, const WCHAR *stname, - const void *data, unsigned sz, BOOL bTable ) + const void *data, unsigned sz, bool bTable ) { HRESULT r; unsigned ret = ERROR_FUNCTION_FAILED; @@ -411,7 +411,7 @@ static unsigned read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage row_size_mem = msi_table_get_row_size( db, t->colinfo, t->col_count, LONG_STR_BYTES ); /* if we can't read the table, just assume that it's empty */ - read_stream_data( stg, t->name, TRUE, &rawdata, &rawsize ); + read_stream_data( stg, t->name, true, &rawdata, &rawsize ); if( !rawdata ) return ERROR_SUCCESS; @@ -427,7 +427,7 @@ static unsigned read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage t->data = msi_alloc_zero( t->row_count * sizeof (uint16_t*) ); if( !t->data ) goto err; - t->data_persistent = msi_alloc_zero( t->row_count * sizeof(BOOL)); + t->data_persistent = msi_alloc_zero( t->row_count * sizeof(bool)); if ( !t->data_persistent ) goto err; @@ -440,7 +440,7 @@ static unsigned read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage t->data[i] = msi_alloc( row_size_mem ); if( !t->data[i] ) goto err; - t->data_persistent[i] = TRUE; + t->data_persistent[i] = true; for (j = 0; j < t->col_count; j++) { @@ -844,7 +844,7 @@ unsigned msi_create_table( MSIDATABASE *db, const WCHAR *name, column_info *col_ if( r ) goto err; - r = tv->ops->insert_row( tv, rec, -1, FALSE ); + r = tv->ops->insert_row( tv, rec, -1, false ); if( r ) goto err; @@ -937,7 +937,7 @@ static unsigned save_table( MSIDATABASE *db, const MSITABLE *t, unsigned bytes_p } TRACE("writing %d bytes\n", rawsize); - r = write_stream_data( db->storage, t->name, rawdata, rawsize, TRUE ); + r = write_stream_data( db->storage, t->name, rawdata, rawsize, true ); err: msi_free( rawdata ); @@ -971,36 +971,36 @@ static void msi_update_table_columns( MSIDATABASE *db, const WCHAR *name ) } /* try to find the table name in the _Tables table */ -BOOL TABLE_Exists( MSIDATABASE *db, const WCHAR *name ) +bool TABLE_Exists( MSIDATABASE *db, const WCHAR *name ) { unsigned r, table_id, i; MSITABLE *table; if( !strcmpW( name, szTables ) || !strcmpW( name, szColumns ) || !strcmpW( name, szStreams ) || !strcmpW( name, szStorages ) ) - return TRUE; + return true; r = msi_string2idW( db->strings, name, &table_id ); if( r != ERROR_SUCCESS ) { TRACE("Couldn't find id for %s\n", debugstr_w(name)); - return FALSE; + return false; } r = get_table( db, szTables, &table ); if( r != ERROR_SUCCESS ) { ERR("table %s not available\n", debugstr_w(szTables)); - return FALSE; + return false; } for( i = 0; i < table->row_count; i++ ) { if( read_table_int( table->data, i, 0, LONG_STR_BYTES ) == table_id ) - return TRUE; + return true; } - return FALSE; + return false; } /* below is the query interface to a table */ @@ -1162,7 +1162,7 @@ static unsigned TABLE_fetch_stream( MSIVIEW *view, unsigned row, unsigned col, I return r; } - encname = encode_streamname( FALSE, full_name ); + encname = encode_streamname( false, full_name ); r = msi_get_raw_stream( tv->db, encname, stm ); if( r ) ERR("fetching stream %s, error = %d\n",debugstr_w(full_name), r); @@ -1315,7 +1315,7 @@ static unsigned TABLE_set_row( MSIVIEW *view, unsigned row, MSIRECORD *rec, unsi for ( i = 0; i < tv->num_cols; i++ ) { - BOOL persistent; + bool persistent; /* only update the fields specified in the mask */ if ( !(mask&(1<table ) return ERROR_INVALID_PARAMETER; @@ -1422,7 +1422,7 @@ static unsigned table_create_new_row( MSIVIEW *view, unsigned *num, BOOL tempora return ERROR_NOT_ENOUGH_MEMORY; } - sz = (*row_count + 1) * sizeof (BOOL); + sz = (*row_count + 1) * sizeof (bool); if( *data_persist_ptr ) b = msi_realloc( *data_persist_ptr, sz ); else @@ -1482,7 +1482,7 @@ static unsigned TABLE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *c } static unsigned TABLE_get_column_info( MSIVIEW *view, - unsigned n, const WCHAR **name, unsigned *type, BOOL *temporary, + unsigned n, const WCHAR **name, unsigned *type, bool *temporary, const WCHAR **table_name ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; @@ -1619,12 +1619,12 @@ static int find_insert_index( MSITABLEVIEW *tv, MSIRECORD *rec ) return high + 1; } -static unsigned TABLE_insert_row( MSIVIEW *view, MSIRECORD *rec, unsigned row, BOOL temporary ) +static unsigned TABLE_insert_row( MSIVIEW *view, MSIRECORD *rec, unsigned row, bool temporary ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; unsigned i, r; - TRACE("%p %p %s\n", tv, rec, temporary ? "TRUE" : "FALSE" ); + TRACE("%p %p %s\n", tv, rec, temporary ? "true" : "false" ); /* check that the key is unique - can we find a matching row? */ r = table_validate_new( tv, rec, NULL ); @@ -1728,7 +1728,7 @@ static unsigned msi_table_assign(MSIVIEW *view, MSIRECORD *rec) if (r == ERROR_SUCCESS) return TABLE_set_row(view, row, rec, (1 << tv->num_cols) - 1); else - return TABLE_insert_row( view, rec, -1, FALSE ); + return TABLE_insert_row( view, rec, -1, false ); } static unsigned modify_delete_row( MSIVIEW *view, MSIRECORD *rec ) @@ -1790,14 +1790,14 @@ static unsigned TABLE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, r = table_validate_new( tv, rec, NULL ); if (r != ERROR_SUCCESS) break; - r = TABLE_insert_row( view, rec, -1, FALSE ); + r = TABLE_insert_row( view, rec, -1, false ); break; case MSIMODIFY_INSERT_TEMPORARY: r = table_validate_new( tv, rec, NULL ); if (r != ERROR_SUCCESS) break; - r = TABLE_insert_row( view, rec, -1, TRUE ); + r = TABLE_insert_row( view, rec, -1, true ); break; case MSIMODIFY_REFRESH: @@ -1819,7 +1819,7 @@ static unsigned TABLE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, { r = table_validate_new( tv, rec, NULL ); if (r == ERROR_SUCCESS) - r = TABLE_insert_row( view, rec, -1, FALSE ); + r = TABLE_insert_row( view, rec, -1, false ); } break; @@ -2019,7 +2019,7 @@ static unsigned TABLE_release(MSIVIEW *view) } static unsigned TABLE_add_column(MSIVIEW *view, const WCHAR *table, unsigned number, - const WCHAR *column, unsigned type, BOOL hold) + const WCHAR *column, unsigned type, bool hold) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSITABLE *msitable; @@ -2035,7 +2035,7 @@ static unsigned TABLE_add_column(MSIVIEW *view, const WCHAR *table, unsigned num MSI_RecordSetStringW(rec, 3, column); MSI_RecordSetInteger(rec, 4, type); - r = TABLE_insert_row(&tv->view, rec, -1, FALSE); + r = TABLE_insert_row(&tv->view, rec, -1, false); if (r != ERROR_SUCCESS) goto done; @@ -2281,7 +2281,7 @@ static unsigned msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECOR continue; } - *pstname = encode_streamname( FALSE, stname ); + *pstname = encode_streamname( false, stname ); msi_free( stname ); return ERROR_SUCCESS; @@ -2530,7 +2530,7 @@ static unsigned msi_table_load_transform( MSIDATABASE *db, IStorage *stg, TRACE("%p %p %p %s\n", db, stg, st, debugstr_w(name) ); /* read the transform data */ - read_stream_data( stg, name, TRUE, &rawdata, &rawsize ); + read_stream_data( stg, name, true, &rawdata, &rawsize ); if ( !rawdata ) { TRACE("table %s empty\n", debugstr_w(name) ); @@ -2664,7 +2664,7 @@ static unsigned msi_table_load_transform( MSIDATABASE *db, IStorage *stg, else { TRACE("inserting row\n"); - r = TABLE_insert_row( &tv->view, rec, -1, FALSE ); + r = TABLE_insert_row( &tv->view, rec, -1, false ); if (r != ERROR_SUCCESS) WARN("failed to insert row %u\n", r); } @@ -2716,7 +2716,7 @@ unsigned msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) list_init(&transforms); - while ( TRUE ) + while ( true ) { MSITABLEVIEW *tv = NULL; WCHAR name[0x40]; diff --git a/libmsi/update.c b/libmsi/update.c index 5224212..f3f64df 100644 --- a/libmsi/update.c +++ b/libmsi/update.c @@ -153,7 +153,7 @@ static unsigned UPDATE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned * } static unsigned UPDATE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; MSIVIEW *wv; diff --git a/libmsi/where.c b/libmsi/where.c index 55d1909..7848749 100644 --- a/libmsi/where.c +++ b/libmsi/where.c @@ -382,7 +382,7 @@ static int INT_evaluate_binary( MSIWHEREVIEW *wv, const unsigned rows[], { if (rl == rr) { - *val = TRUE; + *val = true; return ERROR_CONTINUE; } @@ -390,7 +390,7 @@ static int INT_evaluate_binary( MSIWHEREVIEW *wv, const unsigned rows[], { if ((rl == ERROR_CONTINUE && !rval) || (rr == ERROR_CONTINUE && !lval)) { - *val = FALSE; + *val = false; return ERROR_SUCCESS; } } @@ -398,12 +398,12 @@ static int INT_evaluate_binary( MSIWHEREVIEW *wv, const unsigned rows[], { if ((rl == ERROR_CONTINUE && rval) || (rr == ERROR_CONTINUE && lval)) { - *val = TRUE; + *val = true; return ERROR_SUCCESS; } } - *val = TRUE; + *val = true; return ERROR_CONTINUE; } @@ -521,7 +521,7 @@ static unsigned STRCMP_Evaluate( MSIWHEREVIEW *wv, const unsigned rows[], const const WCHAR *l_str, *r_str; unsigned r; - *val = TRUE; + *val = true; r = STRING_evaluate(wv, rows, expr->left, record, &l_str); if (r == ERROR_CONTINUE) return r; @@ -552,7 +552,7 @@ static unsigned WHERE_evaluate( MSIWHEREVIEW *wv, const unsigned rows[], if( !cond ) { - *val = TRUE; + *val = true; return ERROR_SUCCESS; } @@ -687,7 +687,7 @@ static void add_to_array( JOINTABLE **array, JOINTABLE *elem ) *array = elem; } -static BOOL in_array( JOINTABLE **array, JOINTABLE *elem ) +static bool in_array( JOINTABLE **array, JOINTABLE *elem ) { while (*array && *array != elem) array++; @@ -699,7 +699,7 @@ static BOOL in_array( JOINTABLE **array, JOINTABLE *elem ) a CONST_EXPR comaprison */ static unsigned reorder_check( const struct expr *expr, JOINTABLE **ordered_tables, - BOOL process_joins, JOINTABLE **lastused ) + bool process_joins, JOINTABLE **lastused ) { unsigned res = 0; @@ -747,9 +747,9 @@ static JOINTABLE **ordertables( MSIWHEREVIEW *wv ) if (wv->cond) { table = NULL; - reorder_check(wv->cond, tables, FALSE, &table); + reorder_check(wv->cond, tables, false, &table); table = NULL; - reorder_check(wv->cond, tables, TRUE, &table); + reorder_check(wv->cond, tables, true, &table); } table = wv->tables; @@ -857,7 +857,7 @@ static unsigned WHERE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *c } static unsigned WHERE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, - unsigned *type, BOOL *temporary, const WCHAR **table_name ) + unsigned *type, bool *temporary, const WCHAR **table_name ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table; @@ -1126,7 +1126,7 @@ static unsigned WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, { unsigned type; - *valid = FALSE; + *valid = false; r = parse_column(wv, &cond->u.column, &type); if (r != ERROR_SUCCESS) @@ -1139,7 +1139,7 @@ static unsigned WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, else cond->type = EXPR_COL_NUMBER; - *valid = TRUE; + *valid = true; break; } case EXPR_COMPLEX: @@ -1164,7 +1164,7 @@ static unsigned WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, case OP_NE: break; default: - *valid = FALSE; + *valid = false; return ERROR_INVALID_PARAMETER; } @@ -1177,7 +1177,7 @@ static unsigned WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, case EXPR_UNARY: if ( cond->u.expr.left->type != EXPR_COLUMN ) { - *valid = FALSE; + *valid = false; return ERROR_INVALID_PARAMETER; } r = WHERE_VerifyCondition( wv, cond->u.expr.left, valid ); diff --git a/tests/testdatabase.c b/tests/testdatabase.c index fca4bd7..3794636 100644 --- a/tests/testdatabase.c +++ b/tests/testdatabase.c @@ -137,10 +137,10 @@ static void test_msidatabase(void) ok( res == ERROR_SUCCESS , "Failed to close database\n" ); res = DeleteFile( msifile2 ); - ok( res == TRUE, "Failed to delete database\n" ); + ok( res == true, "Failed to delete database\n" ); res = DeleteFile( msifile ); - ok( res == TRUE, "Failed to delete database\n" ); + ok( res == true, "Failed to delete database\n" ); } static unsigned do_query(MSIOBJECT *hdb, const char *query, MSIOBJECT **phrec) @@ -367,7 +367,7 @@ static void test_msiinsert(void) ok(r == 3, "record count wrong\n"); r = MsiRecordIsNull(hrec, 0); - ok(r == FALSE, "field 0 not null\n"); + ok(r == false, "field 0 not null\n"); r = MsiRecordGetInteger(hrec, 1); ok(r == 1, "field 1 contents wrong\n"); @@ -452,7 +452,7 @@ static void test_msiinsert(void) ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); r = DeleteFile(msifile); - ok(r == TRUE, "file didn't exist after commit\n"); + ok(r == true, "file didn't exist after commit\n"); } static unsigned try_query_param( MSIOBJECT *hdb, const char *szQuery, MSIOBJECT *hrec ) @@ -715,7 +715,7 @@ static void test_msibadqueries(void) ok(r == ERROR_SUCCESS , "Failed to close database transact\n"); r = DeleteFile( msifile ); - ok(r == TRUE, "file didn't exist after commit\n"); + ok(r == true, "file didn't exist after commit\n"); } static void test_viewmodify(void) @@ -1203,7 +1203,7 @@ static unsigned get_columns_table_type(MSIOBJECT *hdb, const char *table, unsign return type; } -static BOOL check_record( MSIOBJECT *rec, unsigned field, const char *val ) +static bool check_record( MSIOBJECT *rec, unsigned field, const char *val ) { char buffer[0x20]; unsigned r; @@ -3233,7 +3233,7 @@ static void test_join(void) char buf[MAX_PATH]; unsigned r, count; unsigned size, i; - BOOL data_correct; + bool data_correct; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -3415,7 +3415,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3425,13 +3425,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_second[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_second[i].two )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3456,7 +3456,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3466,13 +3466,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_third[i].one ) ) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_third[i].two ) ) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3497,7 +3497,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3507,13 +3507,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_fourth[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_fourth[i].two )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3538,7 +3538,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3548,13 +3548,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_fifth[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_fifth[i].two )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3578,7 +3578,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3588,13 +3588,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_sixth[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_sixth[i].two )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3619,7 +3619,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3629,13 +3629,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_seventh[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_seventh[i].two )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3657,7 +3657,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3667,13 +3667,13 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_eighth[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_eighth[i].four )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3694,7 +3694,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3704,25 +3704,25 @@ static void test_join(void) r = MsiRecordGetString( hrec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_eighth[i].one )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_eighth[i].two )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 3, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_eighth[i].three )) - data_correct = FALSE; + data_correct = false; size = MAX_PATH; r = MsiRecordGetString( hrec, 4, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); if( lstrcmp( buf, join_res_eighth[i].four )) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -3743,7 +3743,7 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); i = 0; - data_correct = TRUE; + data_correct = true; while ((r = MsiViewFetch(hview, &hrec)) == ERROR_SUCCESS) { count = MsiRecordGetFieldCount( hrec ); @@ -3751,27 +3751,27 @@ static void test_join(void) r = MsiRecordGetInteger( hrec, 1 ); if( r != join_res_ninth[i].one ) - data_correct = FALSE; + data_correct = false; r = MsiRecordGetInteger( hrec, 2 ); if( r != join_res_ninth[i].two ) - data_correct = FALSE; + data_correct = false; r = MsiRecordGetInteger( hrec, 3 ); if( r != join_res_ninth[i].three ) - data_correct = FALSE; + data_correct = false; r = MsiRecordGetInteger( hrec, 4 ); if( r != join_res_ninth[i].four ) - data_correct = FALSE; + data_correct = false; r = MsiRecordGetInteger( hrec, 5 ); if( r != join_res_ninth[i].five ) - data_correct = FALSE; + data_correct = false; r = MsiRecordGetInteger( hrec, 6); if( r != join_res_ninth[i].six ) - data_correct = FALSE; + data_correct = false; i++; MsiCloseHandle(hrec); @@ -4298,7 +4298,7 @@ static void test_integers(void) ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); r = DeleteFile(msifile); - ok(r == TRUE, "file didn't exist after commit\n"); + ok(r == true, "file didn't exist after commit\n"); } static void test_update(void) @@ -5373,7 +5373,7 @@ static void test_viewmodify_update(void) r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); - while (TRUE) + while (true) { r = MsiViewFetch(hview, &hrec); if (r != ERROR_SUCCESS) @@ -6057,7 +6057,7 @@ static void enum_stream_names(IStorage *stg) ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); n = 0; - while(TRUE) + while(true) { count = 0; hr = IEnumSTATSTG_Next(stgenum, 1, &stat, &count); @@ -7345,20 +7345,20 @@ static void test_where_viewmodify(void) MsiCloseHandle(hdb); } -static BOOL create_storage(const char *name) +static bool create_storage(const char *name) { WCHAR nameW[MAX_PATH]; IStorage *stg; IStream *stm; HRESULT hr; unsigned count; - BOOL res = FALSE; + bool res = false; MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, MAX_PATH); hr = StgCreateDocfile(nameW, STGM_CREATE | STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE, 0, &stg); if (FAILED(hr)) - return FALSE; + return false; hr = IStorage_CreateStream(stg, nameW, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm); @@ -7367,7 +7367,7 @@ static BOOL create_storage(const char *name) hr = IStream_Write(stm, "stgdata", 8, &count); if (SUCCEEDED(hr)) - res = TRUE; + res = true; done: IStream_Release(stm); diff --git a/tests/testdatabase.ok b/tests/testdatabase.ok index 819f76d..0dc7e57 100644 --- a/tests/testdatabase.ok +++ b/tests/testdatabase.ok @@ -32,8 +32,8 @@ ok: res == ERROR_SUCCESS ok: res == ERROR_SUCCESS ok: INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ) ok: res == ERROR_SUCCESS -ok: res == TRUE -ok: res == TRUE +ok: res == true +ok: res == true ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS @@ -54,7 +54,7 @@ ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == 3 -ok: r == FALSE +ok: r == false ok: r == 1 ok: r == ERROR_SUCCESS ok: !strcmp(buf,"Abe") @@ -80,7 +80,7 @@ ok: r == ERROR_SUCCESS ok: r == ERROR_INVALID_PARAMETER ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS -ok: r == TRUE +ok: r == true ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS @@ -144,7 +144,7 @@ ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS -ok: r == TRUE +ok: r == true ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS @@ -992,7 +992,7 @@ ok: i == 7 ok: i == 8 ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS -ok: r == TRUE +ok: r == true ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS diff --git a/tests/testrecord.c b/tests/testrecord.c index 2fbe469..d1f95d6 100644 --- a/tests/testrecord.c +++ b/tests/testrecord.c @@ -25,7 +25,7 @@ static const char *msifile = "winetest-record.msi"; -static BOOL create_temp_file(char *name) +static bool create_temp_file(char *name) { unsigned r; unsigned char buffer[26], i; @@ -125,7 +125,7 @@ static void test_msirecord(void) r = MsiRecordSetString(h, 0, NULL); ok(r == ERROR_SUCCESS, "Failed to set null string at 0\n"); r = MsiRecordIsNull(h, 0); - ok(r == TRUE, "null string not null field\n"); + ok(r == true, "null string not null field\n"); r = MsiRecordDataSize(h, 0); ok(r == 0, "size of string record is strlen\n"); buf[0] = 0; @@ -143,7 +143,7 @@ static void test_msirecord(void) r = MsiRecordSetString(h, 0, ""); ok(r == ERROR_SUCCESS, "Failed to set empty string at 0\n"); r = MsiRecordIsNull(h, 0); - ok(r == TRUE, "null string not null field\n"); + ok(r == true, "null string not null field\n"); r = MsiRecordDataSize(h, 0); ok(r == 0, "size of string record is strlen\n"); buf[0] = 0; @@ -497,7 +497,7 @@ static void test_fieldzero(void) ok(sz == 0, "Expectd 0, got %d\n", sz); r = MsiRecordIsNull(rec, 0); - ok(r == TRUE, "Expected TRUE, got %d\n", r); + ok(r == true, "Expected true, got %d\n", r); r = MsiRecordGetInteger(rec, 1); ok(r == MSI_NULL_INTEGER, "Expected MSI_NULL_INTEGER, got %d\n", r); @@ -516,7 +516,7 @@ static void test_fieldzero(void) ok(sz == 0, "Expectd 0, got %d\n", sz); r = MsiRecordIsNull(rec, 0); - ok(r == TRUE, "Expected TRUE, got %d\n", r); + ok(r == true, "Expected true, got %d\n", r); r = MsiRecordGetInteger(rec, 1); ok(r == 42, "Expected 42, got %d\n", r); @@ -535,7 +535,7 @@ static void test_fieldzero(void) ok(sz == 0, "Expectd 0, got %d\n", sz); r = MsiRecordIsNull(rec, 0); - ok(r == TRUE, "Expected TRUE, got %d\n", r); + ok(r == true, "Expected true, got %d\n", r); sz = MAX_PATH; lstrcpyA(buf, "apple"); @@ -587,7 +587,7 @@ static void test_fieldzero(void) ok(sz == 5, "Expectd 5, got %d\n", sz); r = MsiRecordIsNull(rec, 0); - ok(r == FALSE, "Expected FALSE, got %d\n", r); + ok(r == false, "Expected false, got %d\n", r); MsiCloseHandle(rec); @@ -606,7 +606,7 @@ static void test_fieldzero(void) ok(r != MSI_NULL_INTEGER && r != 0, "Expected non-NULL value, got %d\n", r); r = MsiRecordIsNull(rec, 0); - ok(r == FALSE, "Expected FALSE, got %d\n", r); + ok(r == false, "Expected false, got %d\n", r); r = MsiCloseHandle(hview); ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); diff --git a/tests/testrecord.ok b/tests/testrecord.ok index 70b6b8b..99f4b4e 100644 --- a/tests/testrecord.ok +++ b/tests/testrecord.ok @@ -27,7 +27,7 @@ ok: r == ERROR_INVALID_PARAMETER ok: r==0 ok: r == 1 ok: r == ERROR_SUCCESS -ok: r == TRUE +ok: r == true ok: r == 0 ok: r == ERROR_SUCCESS ok: buf[0] == 0 @@ -36,7 +36,7 @@ ok: r == ERROR_SUCCESS ok: bufW[0] == 0 ok: sz == 0 ok: r == ERROR_SUCCESS -ok: r == TRUE +ok: r == true ok: r == 0 ok: r == ERROR_SUCCESS ok: buf[0] == 0 @@ -172,21 +172,21 @@ ok: r == MSI_NULL_INTEGER ok: r == ERROR_SUCCESS ok: !lstrcmpA(buf, "") ok: sz == 0 -ok: r == TRUE +ok: r == true ok: r == MSI_NULL_INTEGER ok: r == ERROR_SUCCESS ok: r == MSI_NULL_INTEGER ok: r == ERROR_SUCCESS ok: !lstrcmpA(buf, "") ok: sz == 0 -ok: r == TRUE +ok: r == true ok: r == 42 ok: r == ERROR_SUCCESS ok: r == MSI_NULL_INTEGER ok: r == ERROR_SUCCESS ok: !lstrcmpA(buf, "") ok: sz == 0 -ok: r == TRUE +ok: r == true ok: r == ERROR_SUCCESS ok: !lstrcmpA(buf, "bologna") ok: sz == 7 @@ -204,11 +204,11 @@ ok: r == MSI_NULL_INTEGER ok: r == ERROR_SUCCESS ok: !lstrcmpA(buf, "drone") ok: sz == 5 -ok: r == FALSE +ok: r == false ok: r == ERROR_INVALID_TABLE ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r == ERROR_SUCCESS ok: r != MSI_NULL_INTEGER && r != 0 -ok: r == FALSE +ok: r == false ok: r == ERROR_SUCCESS -- cgit