[msitools] Mark pure functions



commit 3e89e06d3bb31122d64ace6c523f8e3f6e828544
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Fri Feb 8 02:09:13 2013 +0100

    Mark pure functions

 libmsi/create.c        |    1 +
 libmsi/insert.c        |    1 +
 libmsi/libmsi-record.c |    3 +++
 libmsi/select.c        |    1 +
 libmsi/string.c        |    3 +++
 libmsi/table.c         |    1 +
 libmsi/tokenize.c      |    1 +
 libmsi/where.c         |    1 +
 tools/sqldelim.c       |    1 +
 9 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libmsi/create.c b/libmsi/create.c
index 745a0e1..19a4344 100644
--- a/libmsi/create.c
+++ b/libmsi/create.c
@@ -125,6 +125,7 @@ static const LibmsiViewOps create_ops =
     NULL,
 };
 
+G_GNUC_PURE
 static unsigned check_columns( const column_info *col_info )
 {
     const column_info *c1, *c2;
diff --git a/libmsi/insert.c b/libmsi/insert.c
index 3a3d81b..11edffe 100644
--- a/libmsi/insert.c
+++ b/libmsi/insert.c
@@ -333,6 +333,7 @@ static const LibmsiViewOps insert_ops =
     NULL,
 };
 
+G_GNUC_PURE
 static unsigned count_column_info( const column_info *ci )
 {
     unsigned n = 0;
diff --git a/libmsi/libmsi-record.c b/libmsi/libmsi-record.c
index 1b391dd..2b6e1a1 100644
--- a/libmsi/libmsi-record.c
+++ b/libmsi/libmsi-record.c
@@ -373,6 +373,7 @@ libmsi_record_get_string (const LibmsiRecord *self, guint field)
     return NULL;
 }
 
+G_GNUC_PURE
 const char *_libmsi_record_get_string_raw( const LibmsiRecord *rec, unsigned field )
 {
     if( field > rec->count )
@@ -748,6 +749,7 @@ LibmsiRecord *_libmsi_record_clone(LibmsiRecord *rec)
     return clone;
 }
 
+G_GNUC_PURE
 bool _libmsi_record_compare_fields(const LibmsiRecord *a, const LibmsiRecord *b, unsigned field)
 {
     if (a->fields[field].type != b->fields[field].type)
@@ -776,6 +778,7 @@ bool _libmsi_record_compare_fields(const LibmsiRecord *a, const LibmsiRecord *b,
 }
 
 
+G_GNUC_PURE
 bool _libmsi_record_compare(const LibmsiRecord *a, const LibmsiRecord *b)
 {
     unsigned i;
diff --git a/libmsi/select.c b/libmsi/select.c
index 7fe5a16..c4ab6fd 100644
--- a/libmsi/select.c
+++ b/libmsi/select.c
@@ -330,6 +330,7 @@ static unsigned select_view_add_column( LibmsiSelectView *sv, const char *name,
     return LIBMSI_RESULT_SUCCESS;
 }
 
+G_GNUC_PURE
 static int select_count_columns( const column_info *col )
 {
     int n;
diff --git a/libmsi/string.c b/libmsi/string.c
index 29cbe91..9514d46 100644
--- a/libmsi/string.c
+++ b/libmsi/string.c
@@ -165,6 +165,7 @@ static int st_find_free_entry( string_table *st )
     return st->freeslot;
 }
 
+G_GNUC_PURE
 static int find_insert_index( const string_table *st, unsigned string_id )
 {
     int i, c, low = 0, high = st->sortcount - 1;
@@ -335,6 +336,7 @@ int _libmsi_add_string( string_table *st, const char *data, int len, uint16_t re
 }
 
 /* find the string identified by an id - return null if there's none */
+G_GNUC_PURE
 const char *msi_string_lookup_id( const string_table *st, unsigned id )
 {
     if( id == 0 )
@@ -672,6 +674,7 @@ err:
     return ret;
 }
 
+G_GNUC_PURE
 unsigned msi_get_string_table_codepage( const string_table *st )
 {
     return st->codepage;
diff --git a/libmsi/table.c b/libmsi/table.c
index 39d72af..6414e14 100644
--- a/libmsi/table.c
+++ b/libmsi/table.c
@@ -467,6 +467,7 @@ void free_cached_tables( LibmsiDatabase *db )
     }
 }
 
+G_GNUC_PURE
 static LibmsiTable *find_cached_table( LibmsiDatabase *db, const char *name )
 {
     LibmsiTable *t;
diff --git a/libmsi/tokenize.c b/libmsi/tokenize.c
index 1320c4a..20a3327 100644
--- a/libmsi/tokenize.c
+++ b/libmsi/tokenize.c
@@ -84,6 +84,7 @@ static const Keyword aKeywordTable[] = {
 /*
 ** Comparison function for binary search.
 */
+G_GNUC_PURE
 static int sql_compare_keyword(const void *m1, const void *m2){
   const char *p = m1;
   const Keyword *k = m2;
diff --git a/libmsi/where.c b/libmsi/where.c
index 5da396a..f0a3082 100644
--- a/libmsi/where.c
+++ b/libmsi/where.c
@@ -680,6 +680,7 @@ static void add_to_array( JOINTABLE **array, JOINTABLE *elem )
         *array = elem;
 }
 
+G_GNUC_PURE
 static bool in_array( JOINTABLE **array, JOINTABLE *elem )
 {
     while (*array && *array != elem)
diff --git a/tools/sqldelim.c b/tools/sqldelim.c
index 645c783..ed2e2b1 100644
--- a/tools/sqldelim.c
+++ b/tools/sqldelim.c
@@ -58,6 +58,7 @@ static const Keyword aKeywordTable[] = {
 /*
 ** Comparison function for binary search.
 */
+G_GNUC_PURE
 static int sql_compare_keyword(const void *m1, const void *m2){
     const uint8_t *p = m1;
     const Keyword *k = m2;


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