From a2863ab370b6864146950e460fd11c3417ac32c2 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 12 Mar 2016 13:34:22 -0800 Subject: [PATCH] Remove old static analysis markup from backend. --- src/backend/dbi/gnc-backend-dbi-priv.h | 4 -- src/backend/dbi/gnc-backend-dbi.cpp | 86 +++++++++++------------- src/backend/dbi/gncmod-backend-dbi.c | 2 +- src/backend/sql/gnc-account-sql.cpp | 22 +++--- src/backend/sql/gnc-backend-sql.cpp | 76 ++++++++------------- src/backend/sql/gnc-backend-sql.h | 49 +++++--------- src/backend/sql/gnc-bill-term-sql.cpp | 6 +- src/backend/sql/gnc-book-sql.cpp | 18 +++-- src/backend/sql/gnc-budget-sql.cpp | 19 ++---- src/backend/sql/gnc-commodity-sql.cpp | 14 ++-- src/backend/sql/gnc-lots-sql.cpp | 16 ++--- src/backend/sql/gnc-price-sql.cpp | 6 +- src/backend/sql/gnc-recurrence-sql.cpp | 40 +++++------ src/backend/sql/gnc-recurrence-sql.h | 2 - src/backend/sql/gnc-schedxaction-sql.cpp | 4 +- src/backend/sql/gnc-slots-sql.cpp | 55 +++++++-------- src/backend/sql/gnc-tax-table-sql.cpp | 6 +- src/backend/sql/gnc-transaction-sql.cpp | 44 +++++------- src/backend/sql/gnc-transaction-sql.h | 1 - 19 files changed, 185 insertions(+), 285 deletions(-) diff --git a/src/backend/dbi/gnc-backend-dbi-priv.h b/src/backend/dbi/gnc-backend-dbi-priv.h index 7e7db5307c..3aefd55b44 100644 --- a/src/backend/dbi/gnc-backend-dbi-priv.h +++ b/src/backend/dbi/gnc-backend-dbi-priv.h @@ -85,7 +85,6 @@ struct GncDbiBackend_struct dbi_conn conn; - /*@ dependent @*/ QofBook *primary_book; /* The primary, main open book */ gboolean loading; /* We are performing an initial load */ gboolean in_query; @@ -104,11 +103,8 @@ typedef struct { GncSqlConnection base; - /*@ observer @*/ QofBackend* qbe; - /*@ observer @*/ dbi_conn conn; - /*@ observer @*/ provider_functions_t* provider; gboolean conn_ok; // Used by the error handler routines to flag if the connection is ok to use gint last_error; // Code of the last error that occurred. This is set in the error callback function diff --git a/src/backend/dbi/gnc-backend-dbi.cpp b/src/backend/dbi/gnc-backend-dbi.cpp index 59cf2354cc..a3b56da27d 100644 --- a/src/backend/dbi/gnc-backend-dbi.cpp +++ b/src/backend/dbi/gnc-backend-dbi.cpp @@ -113,7 +113,7 @@ static gchar lock_table[] = "gnclock"; #define SQLITE3_URI_PREFIX (SQLITE3_URI_TYPE "://") #define PGSQL_DEFAULT_PORT 5432 -static /*@ null @*/ gchar* conn_create_table_ddl_sqlite3( GncSqlConnection* conn, +static gchar* conn_create_table_ddl_sqlite3( GncSqlConnection* conn, const gchar* table_name, const GList* col_info_list ); static GSList* conn_get_table_list( dbi_conn conn, const gchar* dbname ); @@ -131,7 +131,7 @@ static provider_functions_t provider_sqlite3 = }; #define SQLITE3_TIMESPEC_STR_FORMAT "%04d%02d%02d%02d%02d%02d" -static /*@ null @*/ gchar* conn_create_table_ddl_mysql( GncSqlConnection* conn, +static gchar* conn_create_table_ddl_mysql( GncSqlConnection* conn, const gchar* table_name, const GList* col_info_list ); static void append_mysql_col_def( GString* ddl, GncSqlColumnInfo* info ); @@ -147,7 +147,7 @@ static provider_functions_t provider_mysql = }; #define MYSQL_TIMESPEC_STR_FORMAT "%04d%02d%02d%02d%02d%02d" -static /*@ null @*/ gchar* conn_create_table_ddl_pgsql( GncSqlConnection* conn, +static gchar* conn_create_table_ddl_pgsql( GncSqlConnection* conn, const gchar* table_name, const GList* col_info_list ); static GSList* conn_get_table_list_pgsql( dbi_conn conn, const gchar* dbname ); @@ -169,14 +169,14 @@ static gboolean gnc_dbi_lock_database( QofBackend *qbe, gboolean ignore_lock ); static void gnc_dbi_unlock( QofBackend *qbe ); static gboolean save_may_clobber_data( QofBackend* qbe ); -static /*@ null @*/ gchar* create_index_ddl( GncSqlConnection* conn, +static gchar* create_index_ddl( GncSqlConnection* conn, const gchar* index_name, const gchar* table_name, const GncSqlColumnTableEntry* col_table ); -static /*@ null @*/ gchar* add_columns_ddl( GncSqlConnection* conn, +static gchar* add_columns_ddl( GncSqlConnection* conn, const gchar* table_name, GList* col_info_list ); -static GncSqlConnection* create_dbi_connection( /*@ observer @*/ provider_functions_t* provider, /*@ observer @*/ QofBackend* qbe, /*@ observer @*/ dbi_conn conn ); +static GncSqlConnection* create_dbi_connection( provider_functions_t* provider, QofBackend* qbe, dbi_conn conn ); static GncDbiTestResult conn_test_dbi_library( dbi_conn conn ); #define GNC_DBI_PROVIDER_SQLITE (&provider_sqlite3) #define GNC_DBI_PROVIDER_MYSQL (&provider_mysql) @@ -1515,7 +1515,7 @@ gnc_dbi_session_end( QofBackend *be_start ) } static void -gnc_dbi_destroy_backend( /*@ only @*/ QofBackend *be ) +gnc_dbi_destroy_backend( QofBackend *be ) { g_return_if_fail( be != NULL ); @@ -1539,7 +1539,7 @@ gnc_dbi_destroy_backend( /*@ only @*/ QofBackend *be ) * both values to match this version of Gnucash. */ static void -gnc_dbi_load( QofBackend* qbe, /*@ dependent @*/ QofBook *book, QofBackendLoadType loadType ) +gnc_dbi_load( QofBackend* qbe, QofBook *book, QofBackendLoadType loadType ) { GncDbiBackend *be = (GncDbiBackend*)qbe; @@ -1867,9 +1867,9 @@ init_sql_backend( GncDbiBackend* dbi_be ) static QofBackend* new_backend( void (*session_begin)( QofBackend *, QofSession *, const gchar *, - /*@ unused @*/ gboolean, - /*@ unused @*/ gboolean, - /*@ unused @*/ gboolean ) ) + gboolean, + gboolean, + gboolean ) ) { GncDbiBackend *dbi_be; QofBackend *be; @@ -1905,7 +1905,7 @@ gnc_dbi_backend_postgres_new( void ) } static void -gnc_dbi_provider_free( /*@ only @*/ QofBackendProvider *prov ) +gnc_dbi_provider_free( QofBackendProvider *prov ) { g_return_if_fail( prov != NULL ); @@ -2121,13 +2121,12 @@ typedef struct { GncSqlRow base; - /*@ dependent @*/ dbi_result result; GList* gvalue_list; } GncDbiSqlRow; static void -row_dispose( /*@ only @*/ GncSqlRow* row ) +row_dispose( GncSqlRow* row ) { GncDbiSqlRow* dbi_row = (GncDbiSqlRow*)row; GList* node; @@ -2151,7 +2150,7 @@ row_dispose( /*@ only @*/ GncSqlRow* row ) g_free( dbi_row ); } -static /*@ null @*/ const GValue* +static const GValue* row_get_value_at_col_name( GncSqlRow* row, const gchar* col_name ) { GncDbiSqlRow* dbi_row = (GncDbiSqlRow*)row; @@ -2223,7 +2222,7 @@ row_get_value_at_col_name( GncSqlRow* row, const gchar* col_name ) } static GncSqlRow* -create_dbi_row( /*@ dependent @*/ dbi_result result ) +create_dbi_row( dbi_result result ) { GncDbiSqlRow* row; @@ -2241,9 +2240,7 @@ typedef struct { GncSqlResult base; - /*@ observer @*/ GncDbiSqlConnection* dbi_conn; - /*@ owned @*/ dbi_result result; guint num_rows; guint cur_row; @@ -2251,7 +2248,7 @@ typedef struct } GncDbiSqlResult; static void -result_dispose( /*@ only @*/ GncSqlResult* result ) +result_dispose( GncSqlResult* result ) { GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result; @@ -2281,7 +2278,7 @@ result_get_num_rows( GncSqlResult* result ) return dbi_result->num_rows; } -static /*@ null @*/ GncSqlRow* +static GncSqlRow* result_get_first_row( GncSqlResult* result ) { GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result; @@ -2309,7 +2306,7 @@ result_get_first_row( GncSqlResult* result ) } } -static /*@ null @*/ GncSqlRow* +static GncSqlRow* result_get_next_row( GncSqlResult* result ) { GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result; @@ -2338,7 +2335,7 @@ result_get_next_row( GncSqlResult* result ) } static GncSqlResult* -create_dbi_result( /*@ observer @*/ GncDbiSqlConnection* dbi_conn, /*@ owned @*/ dbi_result result ) +create_dbi_result( GncDbiSqlConnection* dbi_conn, dbi_result result ) { GncDbiSqlResult* dbi_result; @@ -2362,12 +2359,11 @@ typedef struct GncSqlStatement base; GString* sql; - /*@ observer @*/ GncSqlConnection* conn; } GncDbiSqlStatement; static void -stmt_dispose( /*@ only @*/ GncSqlStatement* stmt ) +stmt_dispose( GncSqlStatement* stmt ) { GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt; @@ -2387,8 +2383,8 @@ stmt_to_sql( GncSqlStatement* stmt ) } static void -stmt_add_where_cond( GncSqlStatement* stmt, /*@ unused @*/ QofIdTypeConst type_name, - /*@ unused @*/ gpointer obj, const GncSqlColumnTableEntry* table_row, GValue* value ) +stmt_add_where_cond( GncSqlStatement* stmt, QofIdTypeConst type_name, + gpointer obj, const GncSqlColumnTableEntry* table_row, GValue* value ) { GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt; gchar* buf; @@ -2403,7 +2399,7 @@ stmt_add_where_cond( GncSqlStatement* stmt, /*@ unused @*/ QofIdTypeConst type_n } static GncSqlStatement* -create_dbi_statement( /*@ observer @*/ GncSqlConnection* conn, const gchar* sql ) +create_dbi_statement( GncSqlConnection* conn, const gchar* sql ) { GncDbiSqlStatement* stmt; @@ -2420,14 +2416,14 @@ create_dbi_statement( /*@ observer @*/ GncSqlConnection* conn, const gchar* sql } /* --------------------------------------------------------- */ static void -conn_dispose( /*@ only @*/ GncSqlConnection* conn ) +conn_dispose( GncSqlConnection* conn ) { //GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; g_free( conn ); } -static /*@ null @*/ GncSqlResult* +static GncSqlResult* conn_execute_select_statement( GncSqlConnection* conn, GncSqlStatement* stmt ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; @@ -2483,7 +2479,7 @@ conn_execute_nonselect_statement( GncSqlConnection* conn, GncSqlStatement* stmt } static GncSqlStatement* -conn_create_statement_from_sql( /*@ observer @*/ GncSqlConnection* conn, const gchar* sql ) +conn_create_statement_from_sql( GncSqlConnection* conn, const gchar* sql ) { //GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; @@ -2523,7 +2519,7 @@ conn_does_table_exist( GncSqlConnection* conn, const gchar* table_name ) } static gboolean -conn_begin_transaction( /*@ unused @*/ GncSqlConnection* conn ) +conn_begin_transaction( GncSqlConnection* conn ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; dbi_result result; @@ -2563,7 +2559,7 @@ conn_begin_transaction( /*@ unused @*/ GncSqlConnection* conn ) } static gboolean -conn_rollback_transaction( /*@ unused @*/ GncSqlConnection* conn ) +conn_rollback_transaction( GncSqlConnection* conn ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; dbi_result result; @@ -2590,7 +2586,7 @@ conn_rollback_transaction( /*@ unused @*/ GncSqlConnection* conn ) } static gboolean -conn_commit_transaction( /*@ unused @*/ GncSqlConnection* conn ) +conn_commit_transaction( GncSqlConnection* conn ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; dbi_result result; @@ -2616,7 +2612,7 @@ conn_commit_transaction( /*@ unused @*/ GncSqlConnection* conn ) return success; } -static /*@ null @*/ gchar* +static gchar* create_index_ddl( GncSqlConnection* conn, const gchar* index_name, const gchar* table_name, @@ -2645,7 +2641,7 @@ create_index_ddl( GncSqlConnection* conn, return g_string_free( ddl, FALSE ); } -static /*@ null @*/ gchar* +static gchar* add_columns_ddl( GncSqlConnection* conn, const gchar* table_name, GList* col_info_list ) @@ -2725,7 +2721,7 @@ append_sqlite3_col_def( GString* ddl, GncSqlColumnInfo* info ) } } -static /*@ null @*/ gchar* +static gchar* conn_create_table_ddl_sqlite3( GncSqlConnection* conn, const gchar* table_name, const GList* col_info_list ) @@ -2817,7 +2813,7 @@ append_mysql_col_def( GString* ddl, GncSqlColumnInfo* info ) } } -static /*@ null @*/ gchar* +static gchar* conn_create_table_ddl_mysql( GncSqlConnection* conn, const gchar* table_name, const GList* col_info_list ) { @@ -2907,7 +2903,7 @@ append_pgsql_col_def( GString* ddl, GncSqlColumnInfo* info ) } } -static /*@ null @*/ gchar* +static gchar* conn_create_table_ddl_pgsql( GncSqlConnection* conn, const gchar* table_name, const GList* col_info_list ) { @@ -2983,8 +2979,8 @@ conn_create_table( GncSqlConnection* conn, const gchar* table_name, } static gboolean -conn_create_index( /*@ unused @*/ GncSqlConnection* conn, /*@ unused @*/ const gchar* index_name, - /*@ unused @*/ const gchar* table_name, /*@ unused @*/ const GncSqlColumnTableEntry* col_table ) +conn_create_index( GncSqlConnection* conn, const gchar* index_name, + const gchar* table_name, const GncSqlColumnTableEntry* col_table ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; gchar* ddl; @@ -3019,7 +3015,7 @@ conn_create_index( /*@ unused @*/ GncSqlConnection* conn, /*@ unused @*/ const g } static gboolean -conn_add_columns_to_table( /*@ unused @*/ GncSqlConnection* conn, /*@ unused @*/ const gchar* table_name, +conn_add_columns_to_table( GncSqlConnection* conn, const gchar* table_name, GList* col_info_list ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; @@ -3053,7 +3049,7 @@ conn_add_columns_to_table( /*@ unused @*/ GncSqlConnection* conn, /*@ unused @*/ return TRUE; } -static /*@ null @*/ gchar* +static gchar* conn_quote_string( const GncSqlConnection* conn, gchar* unquoted_str ) { GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn; @@ -3240,9 +3236,9 @@ conn_test_dbi_library( dbi_conn conn ) static GncSqlConnection* -create_dbi_connection( /*@ observer @*/ provider_functions_t* provider, - /*@ observer @*/ QofBackend* qbe, - /*@ observer @*/ dbi_conn conn ) +create_dbi_connection( provider_functions_t* provider, + QofBackend* qbe, + dbi_conn conn ) { GncDbiSqlConnection* dbi_conn; diff --git a/src/backend/dbi/gncmod-backend-dbi.c b/src/backend/dbi/gncmod-backend-dbi.c index 3511048024..e01dead6e2 100644 --- a/src/backend/dbi/gncmod-backend-dbi.c +++ b/src/backend/dbi/gncmod-backend-dbi.c @@ -40,7 +40,7 @@ int gnc_module_current = 0; int gnc_module_revision = 0; int gnc_module_age = 0; -/*@ dependent @*//*@ null @*/ + static GNCModule engine; gchar * diff --git a/src/backend/sql/gnc-account-sql.cpp b/src/backend/sql/gnc-account-sql.cpp index 019d9d1bd1..c85c7f9bf7 100644 --- a/src/backend/sql/gnc-account-sql.cpp +++ b/src/backend/sql/gnc-account-sql.cpp @@ -52,9 +52,9 @@ static QofLogModule log_module = G_LOG_DOMAIN; #define TABLE_NAME "accounts" #define TABLE_VERSION 1 -static /*@ null @*//*@ dependent @*/ gpointer get_parent( gpointer pObject ); -static void set_parent( gpointer pObject, /*@ null @*/ gpointer pValue ); -static void set_parent_guid( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_parent( gpointer pObject ); +static void set_parent( gpointer pObject, gpointer pValue ); +static void set_parent_guid( gpointer pObject, gpointer pValue ); #define ACCOUNT_MAX_NAME_LEN 2048 #define ACCOUNT_MAX_TYPE_LEN 2048 @@ -63,7 +63,6 @@ static void set_parent_guid( gpointer pObject, /*@ null @*/ gpointer pValue ); static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "name", CT_STRING, ACCOUNT_MAX_NAME_LEN, COL_NNUL, "name" }, { "account_type", CT_STRING, ACCOUNT_MAX_TYPE_LEN, COL_NNUL, NULL, ACCOUNT_TYPE_ }, @@ -79,25 +78,22 @@ static const GncSqlColumnTableEntry col_table[] = { "hidden", CT_BOOLEAN, 0, 0, "hidden" }, { "placeholder", CT_BOOLEAN, 0, 0, "placeholder" }, { NULL } - /*@ +full_init_block @*/ }; static GncSqlColumnTableEntry parent_col_table[] = { - /*@ -full_init_block @*/ { "parent_guid", CT_GUID, 0, 0, NULL, NULL, NULL, set_parent_guid }, { NULL } - /*@ +full_init_block @*/ }; typedef struct { - /*@ dependent @*/ Account* pAccount; + Account* pAccount; GncGUID guid; } account_parent_guid_struct; /* ================================================================= */ -static /*@ null @*//*@ dependent @*/ gpointer +static gpointer get_parent( gpointer pObject ) { const Account* pAccount; @@ -122,7 +118,7 @@ get_parent( gpointer pObject ) } static void -set_parent( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_parent( gpointer pObject, gpointer pValue ) { Account* pAccount; QofBook* pBook; @@ -145,7 +141,7 @@ set_parent( gpointer pObject, /*@ null @*/ gpointer pValue ) } static void -set_parent_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_parent_guid( gpointer pObject, gpointer pValue ) { account_parent_guid_struct* s = (account_parent_guid_struct*)pObject; GncGUID* guid = (GncGUID*)pValue; @@ -156,7 +152,7 @@ set_parent_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) s->guid = *guid; } -static /*@ dependent @*//*@ null @*/ Account* +static Account* load_single_account( GncSqlBackend* be, GncSqlRow* row, GList** l_accounts_needing_parents ) { @@ -401,7 +397,7 @@ gnc_sql_save_account( GncSqlBackend* be, QofInstance* inst ) /* ================================================================= */ static void load_account_guid( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; diff --git a/src/backend/sql/gnc-backend-sql.cpp b/src/backend/sql/gnc-backend-sql.cpp index 956cf1d1e9..0ede4628e4 100644 --- a/src/backend/sql/gnc-backend-sql.cpp +++ b/src/backend/sql/gnc-backend-sql.cpp @@ -84,17 +84,14 @@ static void update_progress( GncSqlBackend* be ); static void finish_progress( GncSqlBackend* be ); static void register_standard_col_type_handlers( void ); static gboolean reset_version_info( GncSqlBackend* be ); -/*@ null @*/ static GncSqlStatement* build_insert_statement( GncSqlBackend* be, const gchar* table_name, QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry* table ); -/*@ null @*/ static GncSqlStatement* build_update_statement( GncSqlBackend* be, const gchar* table_name, QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry* table ); -/*@ null @*/ static GncSqlStatement* build_delete_statement( GncSqlBackend* be, const gchar* table_name, QofIdTypeConst obj_name, gpointer pObject, @@ -106,8 +103,7 @@ static GList *post_load_commodities = NULL; typedef struct { - /*@ dependent @*/ QofIdType searchObj; - /*@ dependent @*/ + QofIdType searchObj; gpointer pCompiledQuery; } gnc_sql_query_info; @@ -116,15 +112,10 @@ typedef struct { gboolean is_known; gboolean is_ok; - /*@ dependent @*/ GncSqlBackend* be; - /*@ dependent @*/ QofInstance* inst; - /*@ dependent @*/ QofQuery* pQuery; - /*@ dependent @*/ gpointer pCompiledQuery; - /*@ owned @*/ gnc_sql_query_info* pQueryInfo; } sql_backend; @@ -135,7 +126,7 @@ static QofLogModule log_module = G_LOG_DOMAIN; /* ================================================================= */ void -gnc_sql_init( /*@ unused @*/ GncSqlBackend* be ) +gnc_sql_init( GncSqlBackend* be ) { static gboolean initialized = FALSE; @@ -226,7 +217,7 @@ commit_commodity (gpointer data) } void -gnc_sql_load( GncSqlBackend* be, /*@ dependent @*/ QofBook *book, QofBackendLoadType loadType ) +gnc_sql_load( GncSqlBackend* be, QofBook *book, QofBackendLoadType loadType ) { GncSqlObjectBackend* pData; gint i; @@ -304,7 +295,6 @@ static gboolean write_account_tree( GncSqlBackend* be, Account* root ) { GList* descendants; - /*@ dependent @*/ GList* node; gboolean is_ok = TRUE; @@ -453,7 +443,7 @@ finish_progress( GncSqlBackend* be ) } void -gnc_sql_sync_all( GncSqlBackend* be, /*@ dependent @*/ QofBook *book ) +gnc_sql_sync_all( GncSqlBackend* be, QofBook *book ) { gboolean is_ok; @@ -839,7 +829,6 @@ compile_query_cb( const gchar* type, gpointer data_p, gpointer be_data_p ) gchar* gnc_sql_compile_query_to_sql( GncSqlBackend* be, QofQuery* query ); -/*@ null @*/ gpointer gnc_sql_compile_query( QofBackend* pBEnd, QofQuery* pQuery ) { @@ -1132,7 +1121,7 @@ gnc_sql_get_integer_value( const GValue* value ) } /* ----------------------------------------------------------------- */ -/*@ null @*/ static gpointer + static gpointer get_autoinc_id(void *object, const QofParam* param) { // Just need a 0 to force a new autoinc value @@ -1145,7 +1134,7 @@ set_autoinc_id(void* object, void *item) // Nowhere to put the ID } -/*@ null @*/ QofAccessFunc + QofAccessFunc gnc_sql_get_getter( QofIdTypeConst obj_name, const GncSqlColumnTableEntry* table_row ) { QofAccessFunc getter; @@ -1214,7 +1203,7 @@ gint size, gboolean is_unicode ) /* ----------------------------------------------------------------- */ static void load_string( const GncSqlBackend* be, GncSqlRow* row, -/*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -1315,7 +1304,7 @@ typedef void (*IntSetterFunc)( const gpointer, gint ); static void load_int( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -1418,7 +1407,7 @@ typedef void (*BooleanSetterFunc)( const gpointer, gboolean ); static void load_boolean( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -1520,7 +1509,7 @@ typedef void (*Int64SetterFunc)( const gpointer, gint64 ); static void load_int64( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -1612,7 +1601,7 @@ static GncSqlColumnTypeHandler int64_handler static void load_double( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -1726,7 +1715,7 @@ static GncSqlColumnTypeHandler double_handler static void load_guid( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -1915,7 +1904,7 @@ gnc_sql_convert_timespec_to_string( const GncSqlBackend* be, Timespec ts ) static void load_timespec( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -2050,7 +2039,7 @@ static GncSqlColumnTypeHandler timespec_handler static void load_date( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -2201,16 +2190,14 @@ typedef void (*NumericSetterFunc)( gpointer, gnc_numeric ); static const GncSqlColumnTableEntry numeric_col_table[] = { - /*@ -full_init_block @*/ { "num", CT_INT64, 0, COL_NNUL, "guid" }, { "denom", CT_INT64, 0, COL_NNUL, "guid" }, { NULL } - /*@ +full_init_block @*/ }; static void load_numeric( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; @@ -2354,7 +2341,7 @@ static GncSqlColumnTypeHandler numeric_handler }; /* ================================================================= */ -static /*@ null @*//*@ only @*/ GHashTable* g_columnTypeHash = NULL; +static GHashTable* g_columnTypeHash = NULL; void gnc_sql_register_col_type_handler( const gchar* colType, const GncSqlColumnTypeHandler* handler ) @@ -2372,7 +2359,7 @@ gnc_sql_register_col_type_handler( const gchar* colType, const GncSqlColumnTypeH g_hash_table_insert( g_columnTypeHash, (gpointer)colType, (gpointer)handler ); } -/*@ dependent @*//*@ null @*/ static GncSqlColumnTypeHandler* + static GncSqlColumnTypeHandler* get_handler( const GncSqlColumnTableEntry* table_row ) { GncSqlColumnTypeHandler* pHandler; @@ -2409,7 +2396,7 @@ register_standard_col_type_handlers( void ) } void -_retrieve_guid_( gpointer pObject, /*@ null @*/ gpointer pValue ) +_retrieve_guid_( gpointer pObject, gpointer pValue ) { GncGUID* pGuid = (GncGUID*)pObject; GncGUID* guid = (GncGUID*)pValue; @@ -2424,13 +2411,10 @@ _retrieve_guid_( gpointer pObject, /*@ null @*/ gpointer pValue ) // Table to retrieve just the guid static GncSqlColumnTableEntry guid_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, 0, NULL, NULL, NULL, _retrieve_guid_ }, { NULL } - /*@ +full_init_block @*/ }; -/*@ null @*/ const GncGUID* gnc_sql_load_guid( const GncSqlBackend* be, GncSqlRow* row ) { @@ -2447,13 +2431,11 @@ gnc_sql_load_guid( const GncSqlBackend* be, GncSqlRow* row ) // Table to retrieve just the guid static GncSqlColumnTableEntry tx_guid_table[] = { - /*@ -full_init_block @*/ { "tx_guid", CT_GUID, 0, 0, NULL, NULL, NULL, _retrieve_guid_ }, { NULL } - /*@ +full_init_block @*/ }; -/*@ null @*//*@ dependent @*/ + const GncGUID* gnc_sql_load_tx_guid( const GncSqlBackend* be, GncSqlRow* row ) { @@ -2469,7 +2451,7 @@ gnc_sql_load_tx_guid( const GncSqlBackend* be, GncSqlRow* row ) void gnc_sql_load_object( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofIdTypeConst obj_name, gpointer pObject, + QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry* table ) { QofSetterFunc setter; @@ -2504,7 +2486,7 @@ gnc_sql_load_object( const GncSqlBackend* be, GncSqlRow* row, } /* ================================================================= */ -/*@ null @*/ GncSqlStatement* + GncSqlStatement* gnc_sql_create_select_statement( GncSqlBackend* be, const gchar* table_name ) { gchar* sql; @@ -2519,7 +2501,7 @@ gnc_sql_create_select_statement( GncSqlBackend* be, const gchar* table_name ) return stmt; } -/*@ null @*/ static GncSqlStatement* + static GncSqlStatement* create_single_col_select_statement( GncSqlBackend* be, const gchar* table_name, const GncSqlColumnTableEntry* table_row ) @@ -2539,7 +2521,7 @@ create_single_col_select_statement( GncSqlBackend* be, /* ================================================================= */ -/*@ null @*/ GncSqlResult* + GncSqlResult* gnc_sql_execute_select_statement( GncSqlBackend* be, GncSqlStatement* stmt ) { GncSqlResult* result; @@ -2557,7 +2539,7 @@ gnc_sql_execute_select_statement( GncSqlBackend* be, GncSqlStatement* stmt ) return result; } -/*@ null @*/ GncSqlStatement* + GncSqlStatement* gnc_sql_create_statement_from_sql( GncSqlBackend* be, const gchar* sql ) { GncSqlStatement* stmt; @@ -2575,7 +2557,7 @@ gnc_sql_create_statement_from_sql( GncSqlBackend* be, const gchar* sql ) return stmt; } -/*@ null @*/ GncSqlResult* + GncSqlResult* gnc_sql_execute_select_sql( GncSqlBackend* be, const gchar* sql ) { GncSqlStatement* stmt; @@ -2867,7 +2849,7 @@ free_gvalue_list( GSList* list ) g_slist_free( list ); } -/*@ null @*/ static GncSqlStatement* + static GncSqlStatement* build_insert_statement( GncSqlBackend* be, const gchar* table_name, QofIdTypeConst obj_name, gpointer pObject, @@ -2942,7 +2924,7 @@ build_insert_statement( GncSqlBackend* be, return stmt; } -/*@ null @*/ static GncSqlStatement* + static GncSqlStatement* build_update_statement( GncSqlBackend* be, const gchar* table_name, QofIdTypeConst obj_name, gpointer pObject, @@ -3020,7 +3002,7 @@ build_update_statement( GncSqlBackend* be, return stmt; } -/*@ null @*/ static GncSqlStatement* + static GncSqlStatement* build_delete_statement( GncSqlBackend* be, const gchar* table_name, QofIdTypeConst obj_name, gpointer pObject, @@ -3247,11 +3229,9 @@ gboolean gnc_sql_add_columns_to_table( GncSqlBackend* be, const gchar* table_nam static GncSqlColumnTableEntry version_table[] = { - /*@ -full_init_block @*/ { TABLE_COL_NAME, CT_STRING, MAX_TABLE_NAME_LEN, COL_PKEY | COL_NNUL }, { VERSION_COL_NAME, CT_INT, 0, COL_NNUL }, { NULL } - /*@ +full_init_block @*/ }; /** diff --git a/src/backend/sql/gnc-backend-sql.h b/src/backend/sql/gnc-backend-sql.h index 53fa0fe748..f5937574f0 100644 --- a/src/backend/sql/gnc-backend-sql.h +++ b/src/backend/sql/gnc-backend-sql.h @@ -55,7 +55,6 @@ struct GncSqlBackend { QofBackend be; /**< QOF backend */ GncSqlConnection* conn; /**< SQL connection */ - /*@ dependent @*/ QofBook *book; /**< The primary, main open book */ gboolean loading; /**< We are performing an initial load */ gboolean in_query; /**< We are processing a query */ @@ -80,7 +79,7 @@ void gnc_sql_init( GncSqlBackend* be ); * @param be SQL backend * @param book Book to be loaded */ -void gnc_sql_load( GncSqlBackend* be, /*@ dependent @*/ QofBook *book, QofBackendLoadType loadType ); +void gnc_sql_load( GncSqlBackend* be, QofBook *book, QofBackendLoadType loadType ); /** * Register a commodity to be committed after loading is complete. @@ -98,7 +97,7 @@ void gnc_sql_push_commodity_for_postload_processing (GncSqlBackend *be, * @param be SQL backend * @param book Book to be saved */ -void gnc_sql_sync_all( GncSqlBackend* be, /*@ dependent @*/ QofBook *book ); +void gnc_sql_sync_all( GncSqlBackend* be, QofBook *book ); /** * An object is about to be edited. @@ -139,8 +138,7 @@ typedef struct GncSqlRow GncSqlRow; */ struct GncSqlStatement { - void (*dispose)( /*@ only @*/ GncSqlStatement* ); - /*@ dependent @*/ + void (*dispose)( GncSqlStatement* ); gchar* (*toSql)( GncSqlStatement* ); void (*addWhereCond)( GncSqlStatement*, QofIdTypeConst, gpointer, const GncSqlColumnTableEntry*, GValue* ); }; @@ -159,10 +157,10 @@ struct GncSqlStatement */ struct GncSqlConnection { - void (*dispose)( /*@ only @*/ GncSqlConnection* ); + void (*dispose)( GncSqlConnection* ); GncSqlResult* (*executeSelectStatement)( GncSqlConnection*, GncSqlStatement* ); /**< Returns NULL if error */ gint (*executeNonSelectStatement)( GncSqlConnection*, GncSqlStatement* ); /**< Returns -1 if error */ - GncSqlStatement* (*createStatementFromSql)( /*@ observer @*/ GncSqlConnection*, const gchar* ); + GncSqlStatement* (*createStatementFromSql)( GncSqlConnection*, const gchar* ); gboolean (*doesTableExist)( GncSqlConnection*, const gchar* ); /**< Returns true if successful */ gboolean (*beginTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */ gboolean (*rollbackTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */ @@ -205,7 +203,7 @@ struct GncSqlConnection struct GncSqlRow { const GValue* (*getValueAtColName)( GncSqlRow*, const gchar* ); - void (*dispose)( /*@ only @*/ GncSqlRow* ); + void (*dispose)( GncSqlRow* ); }; #define gnc_sql_row_get_value_at_col_name(ROW,N) \ (ROW)->getValueAtColName(ROW,N) @@ -223,7 +221,7 @@ struct GncSqlResult guint (*getNumRows)( GncSqlResult* ); GncSqlRow* (*getFirstRow)( GncSqlResult* ); GncSqlRow* (*getNextRow)( GncSqlResult* ); - void (*dispose)( /*@ only @*/ GncSqlResult* ); + void (*dispose)( GncSqlResult* ); }; #define gnc_sql_result_get_num_rows(RESULT) \ (RESULT)->getNumRows(RESULT) @@ -255,27 +253,20 @@ typedef struct /** Commit an instance of this object to the database * @return TRUE if successful, FALSE if error */ - /*@ null @*/ gboolean (*commit)( GncSqlBackend* be, QofInstance* inst ); /** Load all objects of this type from the database */ - /*@ null @*/ void (*initial_load)( GncSqlBackend* be ); /** Create database tables for this object */ - /*@ null @*/ void (*create_tables)( GncSqlBackend* be ); /** Compile a query on these objects */ - /*@ null @*/ gpointer (*compile_query)( GncSqlBackend* be, QofQuery* pQuery ); /** Run a query on these objects */ - /*@ null @*/ void (*run_query)( GncSqlBackend* be, gpointer pQuery ); /** Free a query on these objects */ - /*@ null @*/ void (*free_query)( GncSqlBackend* be, gpointer pQuery ); /** Write all objects of this type to the database * @return TRUE if successful, FALSE if error */ - /*@ null @*/ gboolean (*write)( GncSqlBackend* be ); } GncSqlObjectBackend; #define GNC_SQL_BACKEND "gnc:sql:1" @@ -302,7 +293,7 @@ typedef enum */ typedef struct { - /*@ only @*/ gchar* name; /**< Column name */ + gchar* name; /**< Column name */ GncSqlBasicColumnType type; /**< Column basic type */ gint size; /**< Column size (string types) */ gboolean is_unicode; /**< Column is unicode (string types) */ @@ -347,7 +338,7 @@ typedef struct */ struct GncSqlColumnTableEntry { - /*@ dependent @*/ const gchar* col_name; /**< Column name */ + const gchar* col_name; /**< Column name */ const gchar* col_type; /**< Column type */ gint size; /**< Column size in bytes, for string columns */ #define COL_PKEY 0x01 /**< The column is a primary key */ @@ -355,13 +346,9 @@ struct GncSqlColumnTableEntry #define COL_UNIQUE 0x04 /**< The column must contain unique values */ #define COL_AUTOINC 0x08 /**< The column is an auto-incrementing int */ gint flags; /**< Column flags */ - /*@ null @*/ const gchar* gobj_param_name; /**< If non-null, g_object param name */ - /*@ null @*/ const gchar* qof_param_name; /**< If non-null, qof parameter name */ - /*@ null @*/ QofAccessFunc getter; /**< General access function */ - /*@ null @*/ QofSetterFunc setter; /**< General setter function */ }; @@ -374,7 +361,7 @@ typedef enum typedef void (*GNC_SQL_LOAD_FN)( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table ); typedef void (*GNC_SQL_ADD_COL_INFO_TO_LIST_FN)( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row, @@ -423,7 +410,6 @@ typedef struct * @param table_row DB table column * @return Access function */ -/*@ null @*/ QofAccessFunc gnc_sql_get_getter( QofIdTypeConst obj_name, const GncSqlColumnTableEntry* table_row ); /** @@ -462,7 +448,6 @@ gboolean gnc_sql_do_db_operation( GncSqlBackend* be, * @param statement Statement * @return Results, or NULL if an error has occured */ -/*@ null @*/ GncSqlResult* gnc_sql_execute_select_statement( GncSqlBackend* be, GncSqlStatement* statement ); /** @@ -474,7 +459,6 @@ GncSqlResult* gnc_sql_execute_select_statement( GncSqlBackend* be, GncSqlStateme * @param sql SQL SELECT string * @return Results, or NULL if an error has occured */ -/*@ null @*/ GncSqlResult* gnc_sql_execute_select_sql( GncSqlBackend* be, const gchar* sql ); /** @@ -493,7 +477,6 @@ gint gnc_sql_execute_nonselect_sql( GncSqlBackend* be, const gchar* sql ); * @param sql SQL char string * @return Statement */ -/*@ null @*/ GncSqlStatement* gnc_sql_create_statement_from_sql( GncSqlBackend* be, const gchar* sql ); /** @@ -506,7 +489,7 @@ GncSqlStatement* gnc_sql_create_statement_from_sql( GncSqlBackend* be, const gch * @param table DB table description */ void gnc_sql_load_object( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofIdTypeConst obj_name, gpointer pObject, + QofIdTypeConst obj_name, gpointer pObject, const GncSqlColumnTableEntry* table ); /** @@ -584,7 +567,7 @@ gboolean gnc_sql_create_index( const GncSqlBackend* be, const gchar* index_name, * @param row Database row * @return GncGUID */ -/*@ dependent @*//*@ null @*/ + const GncGUID* gnc_sql_load_guid( const GncSqlBackend* be, GncSqlRow* row ); /** @@ -595,7 +578,7 @@ const GncGUID* gnc_sql_load_guid( const GncSqlBackend* be, GncSqlRow* row ); * @param row Database row * @return GncGUID */ -/*@ dependent @*//*@ null @*/ + const GncGUID* gnc_sql_load_tx_guid( const GncSqlBackend* be, GncSqlRow* row ); /** @@ -605,7 +588,6 @@ const GncGUID* gnc_sql_load_tx_guid( const GncSqlBackend* be, GncSqlRow* row ); * @param table_name Table name * @return Statement */ -/*@ null @*/ GncSqlStatement* gnc_sql_create_select_statement( GncSqlBackend* be, const gchar* table_name ); @@ -750,16 +732,15 @@ gboolean gnc_sql_add_columns_to_table( GncSqlBackend* be, const gchar* table_nam */ void gnc_sql_set_load_order( const gchar** load_order ); -void _retrieve_guid_( gpointer pObject, /*@ null @*/ gpointer pValue ); +void _retrieve_guid_( gpointer pObject, gpointer pValue ); -/*@ null @*/ gpointer gnc_sql_compile_query( QofBackend* pBEnd, QofQuery* pQuery ); void gnc_sql_free_query( QofBackend* pBEnd, gpointer pQuery ); void gnc_sql_run_query( QofBackend* pBEnd, gpointer pQuery ); typedef struct { - /*@ dependent @*/ GncSqlBackend* be; + GncSqlBackend* be; gboolean is_ok; } write_objects_t; diff --git a/src/backend/sql/gnc-bill-term-sql.cpp b/src/backend/sql/gnc-bill-term-sql.cpp index 31c4f9d5af..56ffda8a7c 100644 --- a/src/backend/sql/gnc-bill-term-sql.cpp +++ b/src/backend/sql/gnc-bill-term-sql.cpp @@ -93,7 +93,7 @@ static GncSqlColumnTableEntry billterm_parent_col_table[] = typedef struct { - /*@ dependent @*/ GncBillTerm* billterm; + GncBillTerm* billterm; GncGUID guid; gboolean have_guid; } billterm_parent_guid_struct; @@ -111,7 +111,7 @@ set_invisible( gpointer data, gboolean value ) } } -static /*@ null @*//*@ dependent @*/ gpointer +static gpointer bt_get_parent( gpointer pObject ) { const GncBillTerm* billterm; @@ -160,7 +160,7 @@ bt_set_parent( gpointer data, gpointer value ) } static void -bt_set_parent_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) +bt_set_parent_guid( gpointer pObject, gpointer pValue ) { billterm_parent_guid_struct* s = (billterm_parent_guid_struct*)pObject; GncGUID* guid = (GncGUID*)pValue; diff --git a/src/backend/sql/gnc-book-sql.cpp b/src/backend/sql/gnc-book-sql.cpp index 2c504befac..4089afe513 100644 --- a/src/backend/sql/gnc-book-sql.cpp +++ b/src/backend/sql/gnc-book-sql.cpp @@ -51,14 +51,13 @@ extern "C" G_GNUC_UNUSED static QofLogModule log_module = G_LOG_DOMAIN; -static /*@ dependent @*//*@ null @*/ gpointer get_root_account_guid( gpointer pObject ); -static void set_root_account_guid( gpointer pObject, /*@ null @*/ gpointer pValue ); -static /*@ dependent @*//*@ null @*/ gpointer get_root_template_guid( gpointer pObject ); -static void set_root_template_guid( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_root_account_guid( gpointer pObject ); +static void set_root_account_guid( gpointer pObject, gpointer pValue ); +static gpointer get_root_template_guid( gpointer pObject ); +static void set_root_template_guid( gpointer pObject, gpointer pValue ); static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "root_account_guid", CT_GUID, 0, COL_NNUL, NULL, NULL, @@ -69,11 +68,10 @@ static const GncSqlColumnTableEntry col_table[] = (QofAccessFunc)get_root_template_guid, set_root_template_guid }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_root_account_guid( gpointer pObject ) { QofBook* book = QOF_BOOK(pObject); @@ -87,7 +85,7 @@ get_root_account_guid( gpointer pObject ) } static void -set_root_account_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_root_account_guid( gpointer pObject, gpointer pValue ) { QofBook* book = QOF_BOOK(pObject); const Account* root; @@ -101,7 +99,7 @@ set_root_account_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) qof_instance_set_guid( QOF_INSTANCE(root), guid ); } -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_root_template_guid( gpointer pObject ) { const QofBook* book = QOF_BOOK(pObject); @@ -115,7 +113,7 @@ get_root_template_guid( gpointer pObject ) } static void -set_root_template_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_root_template_guid( gpointer pObject, gpointer pValue ) { QofBook* book = QOF_BOOK(pObject); GncGUID* guid = (GncGUID*)pValue; diff --git a/src/backend/sql/gnc-budget-sql.cpp b/src/backend/sql/gnc-budget-sql.cpp index da94857db1..b81dcfcd7d 100644 --- a/src/backend/sql/gnc-budget-sql.cpp +++ b/src/backend/sql/gnc-budget-sql.cpp @@ -49,25 +49,23 @@ extern "C" #define AMOUNTS_TABLE "budget_amounts" #define AMOUNTS_TABLE_VERSION 1 -/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN; + static QofLogModule log_module = G_LOG_DOMAIN; #define BUDGET_MAX_NAME_LEN 2048 #define BUDGET_MAX_DESCRIPTION_LEN 2048 static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "name", CT_STRING, BUDGET_MAX_NAME_LEN, COL_NNUL, "name" }, { "description", CT_STRING, BUDGET_MAX_DESCRIPTION_LEN, 0, "description" }, { "num_periods", CT_INT, 0, COL_NNUL, "num_periods" }, { NULL } - /*@ +full_init_block @*/ }; -static /*@ dependent @*//*@ null @*/ QofInstance* get_budget( gpointer pObj ); +static QofInstance* get_budget( gpointer pObj ); static void set_budget( gpointer pObj, gpointer val ); -static /*@ dependent @*//*@ null @*/ QofInstance* get_account( gpointer pObj ); +static QofInstance* get_account( gpointer pObj ); static void set_account( gpointer pObj, gpointer val ); static gint get_period_num( gpointer pObj ); static void set_period_num( gpointer pObj, gpointer val ); @@ -83,7 +81,6 @@ typedef struct static const GncSqlColumnTableEntry budget_amounts_col_table[] = { - /*@ -full_init_block @*/ { "id", CT_INT, 0, COL_NNUL | COL_PKEY | COL_AUTOINC }, { "budget_guid", CT_BUDGETREF, 0, COL_NNUL, NULL, NULL, @@ -102,11 +99,10 @@ static const GncSqlColumnTableEntry budget_amounts_col_table[] = (QofAccessFunc)get_amount, (QofSetterFunc)set_amount }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ dependent @*//*@ null@ */ QofInstance* +static QofInstance* get_budget( gpointer pObj ) { budget_amount_info_t* info = (budget_amount_info_t*)pObj; @@ -121,7 +117,7 @@ set_budget( gpointer pObj, gpointer val ) { } -static /*@ dependent @*//*@ null @*/ QofInstance* +static QofInstance* get_account( gpointer pObj ) { budget_amount_info_t* info = (budget_amount_info_t*)pObj; @@ -257,7 +253,6 @@ static gboolean save_budget_amounts( GncSqlBackend* be, GncBudget* budget ) { GList* descendants; - /*@ dependent @*/ GList* node; budget_amount_info_t info; guint num_periods; @@ -292,7 +287,7 @@ save_budget_amounts( GncSqlBackend* be, GncBudget* budget ) return is_ok; } /*----------------------------------------------------------------*/ -static /*@ dependent @*//*@ null @*/ GncBudget* +static GncBudget* load_single_budget( GncSqlBackend* be, GncSqlRow* row ) { const GncGUID* guid; @@ -477,7 +472,7 @@ write_budgets( GncSqlBackend* be ) /* ================================================================= */ static void load_budget_guid( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; diff --git a/src/backend/sql/gnc-commodity-sql.cpp b/src/backend/sql/gnc-commodity-sql.cpp index 63f70200bc..a44108210d 100644 --- a/src/backend/sql/gnc-commodity-sql.cpp +++ b/src/backend/sql/gnc-commodity-sql.cpp @@ -43,10 +43,10 @@ extern "C" #include "splint-defs.h" #endif -/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN; + static QofLogModule log_module = G_LOG_DOMAIN; -static /*@ dependent @*//*@ null @*/ gpointer get_quote_source_name( gpointer pObject ); -static void set_quote_source_name( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_quote_source_name( gpointer pObject ); +static void set_quote_source_name( gpointer pObject, gpointer pValue ); #define COMMODITIES_TABLE "commodities" #define TABLE_VERSION 1 @@ -60,7 +60,6 @@ static void set_quote_source_name( gpointer pObject, /*@ null @*/ gpointer pValu static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "namespace", CT_STRING, COMMODITY_MAX_NAMESPACE_LEN, COL_NNUL, NULL, NULL, @@ -78,12 +77,11 @@ static const GncSqlColumnTableEntry col_table[] = }, { "quote_tz", CT_STRING, COMMODITY_MAX_QUOTE_TZ_LEN, 0, "quote-tz" }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_quote_source_name( gpointer pObject ) { const gnc_commodity* pCommodity; @@ -113,7 +111,7 @@ set_quote_source_name( gpointer pObject, gpointer pValue ) gnc_commodity_set_quote_source( pCommodity, quote_source ); } -static /*@ dependent @*/ gnc_commodity* +static gnc_commodity* load_single_commodity( GncSqlBackend* be, GncSqlRow* row ) { QofBook* pBook = be->book; @@ -274,7 +272,7 @@ gnc_sql_commit_commodity (gnc_commodity *pCommodity) static void load_commodity_guid( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; diff --git a/src/backend/sql/gnc-lots-sql.cpp b/src/backend/sql/gnc-lots-sql.cpp index 087f0088a0..2a84edc683 100644 --- a/src/backend/sql/gnc-lots-sql.cpp +++ b/src/backend/sql/gnc-lots-sql.cpp @@ -45,17 +45,16 @@ extern "C" #include "gnc-lots-sql.h" -/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN; + static QofLogModule log_module = G_LOG_DOMAIN; #define TABLE_NAME "lots" #define TABLE_VERSION 2 -static /*@ dependent @*//*@ null @*/ gpointer get_lot_account( gpointer pObject ); -static void set_lot_account( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_lot_account( gpointer pObject ); +static void set_lot_account( gpointer pObject, gpointer pValue ); static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "account_guid", CT_ACCOUNTREF, 0, 0, NULL, NULL, @@ -63,11 +62,10 @@ static const GncSqlColumnTableEntry col_table[] = }, { "is_closed", CT_BOOLEAN, 0, COL_NNUL, "is-closed" }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_lot_account( gpointer pObject ) { const GNCLot* lot; @@ -82,7 +80,7 @@ get_lot_account( gpointer pObject ) } static void -set_lot_account( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_lot_account( gpointer pObject, gpointer pValue ) { GNCLot* lot; Account* pAccount; @@ -98,7 +96,7 @@ set_lot_account( gpointer pObject, /*@ null @*/ gpointer pValue ) } } -static /*@ dependent @*//*@ null @*/ GNCLot* +static GNCLot* load_single_lot( GncSqlBackend* be, GncSqlRow* row ) { GNCLot* lot; @@ -216,7 +214,7 @@ write_lots( GncSqlBackend* be ) /* ================================================================= */ static void load_lot_guid( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; diff --git a/src/backend/sql/gnc-price-sql.cpp b/src/backend/sql/gnc-price-sql.cpp index a1fa71b1cd..8235e7c0a4 100644 --- a/src/backend/sql/gnc-price-sql.cpp +++ b/src/backend/sql/gnc-price-sql.cpp @@ -45,7 +45,7 @@ extern "C" #include "gnc-slots-sql.h" -/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN; + static QofLogModule log_module = G_LOG_DOMAIN; #define TABLE_NAME "prices" #define TABLE_VERSION 2 @@ -55,7 +55,6 @@ extern "C" static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "commodity_guid", CT_COMMODITYREF, 0, COL_NNUL, "commodity" }, { "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, "currency" }, @@ -64,12 +63,11 @@ static const GncSqlColumnTableEntry col_table[] = { "type", CT_STRING, PRICE_MAX_TYPE_LEN, 0, "type" }, { "value", CT_NUMERIC, 0, COL_NNUL, "value" }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ null @*//*@ dependent @*/ GNCPrice* +static GNCPrice* load_single_price( GncSqlBackend* be, GncSqlRow* row ) { GNCPrice* pPrice; diff --git a/src/backend/sql/gnc-recurrence-sql.cpp b/src/backend/sql/gnc-recurrence-sql.cpp index af2df18afd..1f49b8b44f 100644 --- a/src/backend/sql/gnc-recurrence-sql.cpp +++ b/src/backend/sql/gnc-recurrence-sql.cpp @@ -53,27 +53,24 @@ G_GNUC_UNUSED static QofLogModule log_module = G_LOG_DOMAIN; typedef struct { - /*@ dependent @*/ GncSqlBackend* be; - /*@ dependent @*/ + GncSqlBackend* be; const GncGUID* guid; - /*@ dependent @*/ Recurrence* pRecurrence; } recurrence_info_t; -static /*@ null @*/ gpointer get_obj_guid( gpointer pObject ); +static gpointer get_obj_guid( gpointer pObject ); static void set_obj_guid( void ); static gint get_recurrence_mult( gpointer pObject ); static void set_recurrence_mult( gpointer pObject, gint value ); -static /*@ null @*/ gpointer get_recurrence_period_type( gpointer pObject ); -static void set_recurrence_period_type( gpointer pObject, /*@ null @*/ gpointer pValue ); -static /*@ null @*/ gpointer get_recurrence_weekend_adjust( gpointer pObject ); -static void set_recurrence_weekend_adjust( gpointer pObject, /*@ null @*/ gpointer pValue ); -static /*@ dependent @*//*@ null @*/ gpointer get_recurrence_period_start( gpointer pObject ); -static void set_recurrence_period_start( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_recurrence_period_type( gpointer pObject ); +static void set_recurrence_period_type( gpointer pObject, gpointer pValue ); +static gpointer get_recurrence_weekend_adjust( gpointer pObject ); +static void set_recurrence_weekend_adjust( gpointer pObject, gpointer pValue ); +static gpointer get_recurrence_period_start( gpointer pObject ); +static void set_recurrence_period_start( gpointer pObject, gpointer pValue ); static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "id", CT_INT, 0, COL_PKEY | COL_NNUL | COL_AUTOINC }, { "obj_guid", CT_GUID, 0, COL_NNUL, NULL, NULL, @@ -96,36 +93,31 @@ static const GncSqlColumnTableEntry col_table[] = (QofAccessFunc)get_recurrence_weekend_adjust, set_recurrence_weekend_adjust }, { NULL } - /*@ +full_init_block @*/ }; /* Special column table because we need to be able to access the table by a column other than the primary key */ static const GncSqlColumnTableEntry guid_col_table[] = { - /*@ -full_init_block @*/ { "obj_guid", CT_GUID, 0, 0, NULL, NULL, (QofAccessFunc)get_obj_guid, (QofSetterFunc)set_obj_guid }, { NULL } - /*@ +full_init_block @*/ }; /* Special column table used to upgrade table from version 1 to 2 */ static const GncSqlColumnTableEntry weekend_adjust_col_table[] = { - /*@ -full_init_block @*/ { "recurrence_weekend_adjust", CT_STRING, BUDGET_MAX_RECURRENCE_WEEKEND_ADJUST_LEN, 0, }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ null @*/ gpointer +static gpointer get_obj_guid( gpointer pObject ) { recurrence_info_t* pInfo = (recurrence_info_t*)pObject; @@ -163,7 +155,7 @@ set_recurrence_mult( gpointer pObject, gint value ) pInfo->pRecurrence->mult = (guint16)value; } -static /*@ null @*/ gpointer +static gpointer get_recurrence_period_type( gpointer pObject ) { recurrence_info_t* pInfo = (recurrence_info_t*)pObject; @@ -187,7 +179,7 @@ set_recurrence_period_type( gpointer pObject, gpointer pValue ) pInfo->pRecurrence->ptype = recurrencePeriodTypeFromString( (gchar*)pValue ); } -static /*@ null @*/ gpointer +static gpointer get_recurrence_weekend_adjust( gpointer pObject ) { recurrence_info_t* pInfo = (recurrence_info_t*)pObject; @@ -211,7 +203,7 @@ set_recurrence_weekend_adjust( gpointer pObject, gpointer pValue ) pInfo->pRecurrence->wadj = recurrenceWeekendAdjustFromString( (gchar*)pValue ); } -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_recurrence_period_start( gpointer pObject ) { recurrence_info_t* pInfo = (recurrence_info_t*)pObject; @@ -293,7 +285,7 @@ gnc_sql_recurrence_delete( GncSqlBackend* be, const GncGUID* guid ) } static void -load_recurrence( GncSqlBackend* be, GncSqlRow* row, /*@ out @*/ Recurrence* r ) +load_recurrence( GncSqlBackend* be, GncSqlRow* row, Recurrence* r ) { recurrence_info_t recurrence_info; @@ -307,7 +299,7 @@ load_recurrence( GncSqlBackend* be, GncSqlRow* row, /*@ out @*/ Recurrence* r ) gnc_sql_load_object( be, row, TABLE_NAME, &recurrence_info, col_table ); } -static /*@ null @*/ GncSqlResult* +static GncSqlResult* gnc_sql_set_recurrences_from_db( GncSqlBackend* be, const GncGUID* guid ) { gchar* buf; @@ -327,7 +319,7 @@ gnc_sql_set_recurrences_from_db( GncSqlBackend* be, const GncGUID* guid ) return result; } -/*@ null @*/ Recurrence* + Recurrence* gnc_sql_recurrence_load( GncSqlBackend* be, const GncGUID* guid ) { GncSqlResult* result; @@ -361,7 +353,7 @@ gnc_sql_recurrence_load( GncSqlBackend* be, const GncGUID* guid ) return r; } -/*@ null @*/ GList* + GList* gnc_sql_recurrence_load_list( GncSqlBackend* be, const GncGUID* guid ) { GncSqlResult* result; diff --git a/src/backend/sql/gnc-recurrence-sql.h b/src/backend/sql/gnc-recurrence-sql.h index 24caa2a883..c03826ee66 100644 --- a/src/backend/sql/gnc-recurrence-sql.h +++ b/src/backend/sql/gnc-recurrence-sql.h @@ -39,9 +39,7 @@ extern "C" gboolean gnc_sql_recurrence_save( GncSqlBackend* be, const GncGUID* guid, const Recurrence* pRecurrence ); void gnc_sql_recurrence_save_list( GncSqlBackend* be, const GncGUID* guid, GList* schedule ); gboolean gnc_sql_recurrence_delete( GncSqlBackend* be, const GncGUID* guid ); -/*@ null @*/ Recurrence* gnc_sql_recurrence_load( GncSqlBackend* be, const GncGUID* guid ); -/*@ null @*/ GList* gnc_sql_recurrence_load_list( GncSqlBackend* be, const GncGUID* guid ); void gnc_sql_init_recurrence_handler( void ); diff --git a/src/backend/sql/gnc-schedxaction-sql.cpp b/src/backend/sql/gnc-schedxaction-sql.cpp index 15efc4a9fb..be8c423b27 100644 --- a/src/backend/sql/gnc-schedxaction-sql.cpp +++ b/src/backend/sql/gnc-schedxaction-sql.cpp @@ -57,7 +57,6 @@ G_GNUC_UNUSED static QofLogModule log_module = G_LOG_DOMAIN; static const GncSqlColumnTableEntry col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "name", CT_STRING, SX_MAX_NAME_LEN, 0, "name" }, { "enabled", CT_BOOLEAN, 0, COL_NNUL, "enabled" }, @@ -73,11 +72,10 @@ static const GncSqlColumnTableEntry col_table[] = { "instance_count", CT_INT, 0, COL_NNUL, "instance-count" }, { "template_act_guid", CT_ACCOUNTREF, 0, COL_NNUL, "template-account" }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ null @*/ SchedXaction* +static SchedXaction* load_single_sx( GncSqlBackend* be, GncSqlRow* row ) { const GncGUID* guid; diff --git a/src/backend/sql/gnc-slots-sql.cpp b/src/backend/sql/gnc-slots-sql.cpp index dfbe95dfae..67209f7faa 100644 --- a/src/backend/sql/gnc-slots-sql.cpp +++ b/src/backend/sql/gnc-slots-sql.cpp @@ -43,7 +43,7 @@ extern "C" #include -/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN; + static QofLogModule log_module = G_LOG_DOMAIN; #define TABLE_NAME "slots" #define TABLE_VERSION 3 @@ -57,37 +57,34 @@ typedef enum typedef struct { - /*@ dependent @*/ GncSqlBackend* be; - /*@ dependent @*/ + GncSqlBackend* be; const GncGUID* guid; gboolean is_ok; - /*@ dependent @*/ KvpFrame* pKvpFrame; KvpValue::Type value_type; GList *pList; context_t context; - /*@ dependent @*/ KvpValue* pKvpValue; GString* path; } slot_info_t; -static /*@ null @*/ gpointer get_obj_guid( gpointer pObject ); +static gpointer get_obj_guid( gpointer pObject ); static void set_obj_guid( void ); -static /*@ null @*/ gpointer get_path( gpointer pObject ); -static void set_path( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_path( gpointer pObject ); +static void set_path( gpointer pObject, gpointer pValue ); static KvpValue::Type get_slot_type( gpointer pObject ); -static void set_slot_type( gpointer pObject, /*@ null @*/ gpointer pValue ); +static void set_slot_type( gpointer pObject, gpointer pValue ); static gint64 get_int64_val( gpointer pObject ); static void set_int64_val( gpointer pObject, gint64 pValue ); -static /*@ null @*/ gpointer get_string_val( gpointer pObject ); -static void set_string_val( gpointer pObject, /*@ null @*/ gpointer pValue ); -static /*@ dependent @*//*@ null @*/ gpointer get_double_val( gpointer pObject ); -static void set_double_val( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_string_val( gpointer pObject ); +static void set_string_val( gpointer pObject, gpointer pValue ); +static gpointer get_double_val( gpointer pObject ); +static void set_double_val( gpointer pObject, gpointer pValue ); static Timespec get_timespec_val( gpointer pObject ); static void set_timespec_val( gpointer pObject, Timespec ts ); -static /*@ null @*/ gpointer get_guid_val( gpointer pObject ); -static void set_guid_val( gpointer pObject, /*@ null @*/ gpointer pValue ); +static gpointer get_guid_val( gpointer pObject ); +static void set_guid_val( gpointer pObject, gpointer pValue ); static gnc_numeric get_numeric_val( gpointer pObject ); static void set_numeric_val( gpointer pObject, gnc_numeric value ); static GDate* get_gdate_val( gpointer pObject ); @@ -115,7 +112,6 @@ enum static const GncSqlColumnTableEntry col_table[] = { /* col_name, col_type, size, flags, g0bj_param_name, qof_param_name, getter, setter */ - /*@ -full_init_block @*/ { "id", CT_INT, 0, COL_PKEY | COL_NNUL | COL_AUTOINC }, { "obj_guid", CT_GUID, 0, COL_NNUL, NULL, NULL, @@ -158,25 +154,20 @@ static const GncSqlColumnTableEntry col_table[] = (QofAccessFunc)get_gdate_val, (QofSetterFunc)set_gdate_val }, { NULL } - /*@ +full_init_block @*/ }; /* Special column table because we need to be able to access the table by a column other than the primary key */ static const GncSqlColumnTableEntry obj_guid_col_table[] = { - /*@ -full_init_block @*/ { "obj_guid", CT_GUID, 0, 0, NULL, NULL, (QofAccessFunc)get_obj_guid, _retrieve_guid_ }, { NULL } - /*@ +full_init_block @*/ }; static const GncSqlColumnTableEntry gdate_col_table[] = { - /*@ -full_init_block @*/ { "gdate_val", CT_GDATE, 0, 0, }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ @@ -280,7 +271,7 @@ set_slot_from_value( slot_info_t *pInfo, KvpValue *pValue) } } -static /*@ null @*/ gpointer +static gpointer get_obj_guid( gpointer pObject ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -296,7 +287,7 @@ set_obj_guid( void ) // Nowhere to put the GncGUID } -static /*@ null @*/ gpointer +static gpointer get_path( gpointer pObject ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -307,7 +298,7 @@ get_path( gpointer pObject ) } static void -set_path( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_path( gpointer pObject, gpointer pValue ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -333,7 +324,7 @@ get_slot_type( gpointer pObject ) } static void -set_slot_type( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_slot_type( gpointer pObject, gpointer pValue ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -373,7 +364,7 @@ set_int64_val( gpointer pObject, gint64 value ) set_slot_from_value( pInfo, pValue ); } -static /*@ null @*/ gpointer +static gpointer get_string_val( gpointer pObject ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -391,7 +382,7 @@ get_string_val( gpointer pObject ) } static void -set_string_val( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_string_val( gpointer pObject, gpointer pValue ) { slot_info_t* pInfo = (slot_info_t*)pObject; g_return_if_fail( pObject != NULL ); @@ -403,7 +394,7 @@ set_string_val( gpointer pObject, /*@ null @*/ gpointer pValue ) set_slot_from_value( pInfo, value ); } -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_double_val( gpointer pObject ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -423,7 +414,7 @@ get_double_val( gpointer pObject ) } static void -set_double_val( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_double_val( gpointer pObject, gpointer pValue ) { slot_info_t* pInfo = (slot_info_t*)pObject; KvpValue *value = NULL; @@ -459,7 +450,7 @@ set_timespec_val( gpointer pObject, Timespec ts ) set_slot_from_value( pInfo, value ); } -static /*@ null @*/ gpointer +static gpointer get_guid_val( gpointer pObject ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -477,7 +468,7 @@ get_guid_val( gpointer pObject ) } static void -set_guid_val( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_guid_val( gpointer pObject, gpointer pValue ) { slot_info_t* pInfo = (slot_info_t*)pObject; @@ -869,7 +860,7 @@ slots_load_info ( slot_info_t *pInfo ) } } -static /*@ dependent @*//*@ null @*/ const GncGUID* +static const GncGUID* load_obj_guid( const GncSqlBackend* be, GncSqlRow* row ) { static GncGUID guid; diff --git a/src/backend/sql/gnc-tax-table-sql.cpp b/src/backend/sql/gnc-tax-table-sql.cpp index d0512b1674..b279f8f01a 100644 --- a/src/backend/sql/gnc-tax-table-sql.cpp +++ b/src/backend/sql/gnc-tax-table-sql.cpp @@ -120,7 +120,7 @@ static GncSqlColumnTableEntry guid_col_table[] = typedef struct { - /*@ dependent @*/ GncTaxTable* tt; + GncTaxTable* tt; GncGUID guid; gboolean have_guid; } taxtable_parent_guid_struct; @@ -141,7 +141,7 @@ set_obj_guid( gpointer pObject, gpointer pValue ) // Nowhere to put the GncGUID } -static /*@ null @*//*@ dependent @*/ gpointer +static gpointer bt_get_parent( gpointer pObject ) { const GncTaxTable* tt; @@ -190,7 +190,7 @@ tt_set_parent( gpointer data, gpointer value ) } static void -tt_set_parent_guid( gpointer pObject, /*@ null @*/ gpointer pValue ) +tt_set_parent_guid( gpointer pObject, gpointer pValue ) { taxtable_parent_guid_struct* s = (taxtable_parent_guid_struct*)pObject; GncGUID* guid = (GncGUID*)pValue; diff --git a/src/backend/sql/gnc-transaction-sql.cpp b/src/backend/sql/gnc-transaction-sql.cpp index baf6c0c62c..07231ed6f6 100644 --- a/src/backend/sql/gnc-transaction-sql.cpp +++ b/src/backend/sql/gnc-transaction-sql.cpp @@ -66,8 +66,7 @@ static QofLogModule log_module = G_LOG_DOMAIN; typedef struct { - /*@ dependent @*/ GncSqlBackend* be; - /*@ dependent @*/ + GncSqlBackend* be; const GncGUID* guid; gboolean is_ok; } split_info_t; @@ -77,7 +76,6 @@ typedef struct static const GncSqlColumnTableEntry tx_col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, "currency" }, { "num", CT_STRING, TX_MAX_NUM_LEN, COL_NNUL, "num" }, @@ -85,19 +83,17 @@ static const GncSqlColumnTableEntry tx_col_table[] = { "enter_date", CT_TIMESPEC, 0, 0, "enter-date" }, { "description", CT_STRING, TX_MAX_DESCRIPTION_LEN, 0, "description" }, { NULL } - /*@ +full_init_block @*/ }; -static /*@ dependent @*//*@ null @*/ gpointer get_split_reconcile_state( gpointer pObject ); -static void set_split_reconcile_state( gpointer pObject, /*@ null @*/ gpointer pValue ); -static void set_split_lot( gpointer pObject, /*@ null @*/ gpointer pLot ); +static gpointer get_split_reconcile_state( gpointer pObject ); +static void set_split_reconcile_state( gpointer pObject, gpointer pValue ); +static void set_split_lot( gpointer pObject, gpointer pLot ); #define SPLIT_MAX_MEMO_LEN 2048 #define SPLIT_MAX_ACTION_LEN 2048 static const GncSqlColumnTableEntry split_col_table[] = { - /*@ -full_init_block @*/ { "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" }, { "tx_guid", CT_TXREF, 0, COL_NNUL, "transaction" }, { "account_guid", CT_ACCOUNTREF, 0, COL_NNUL, "account" }, @@ -115,36 +111,29 @@ static const GncSqlColumnTableEntry split_col_table[] = (QofAccessFunc)xaccSplitGetLot, set_split_lot }, { NULL } - /*@ +full_init_block @*/ }; static const GncSqlColumnTableEntry post_date_col_table[] = { - /*@ -full_init_block @*/ { "post_date", CT_TIMESPEC, 0, 0, "post-date" }, { NULL } - /*@ +full_init_block @*/ }; static const GncSqlColumnTableEntry account_guid_col_table[] = { - /*@ -full_init_block @*/ { "account_guid", CT_ACCOUNTREF, 0, COL_NNUL, "account" }, { NULL } - /*@ +full_init_block @*/ }; static const GncSqlColumnTableEntry tx_guid_col_table[] = { - /*@ -full_init_block @*/ { "tx_guid", CT_GUID, 0, 0, "guid" }, { NULL } - /*@ +full_init_block @*/ }; /* ================================================================= */ -static /*@ dependent @*//*@ null @*/ gpointer +static gpointer get_split_reconcile_state( gpointer pObject ) { static gchar c[2]; @@ -158,7 +147,7 @@ get_split_reconcile_state( gpointer pObject ) } static void -set_split_reconcile_state( gpointer pObject, /*@ null @*/ gpointer pValue ) +set_split_reconcile_state( gpointer pObject, gpointer pValue ) { const gchar* s = (const gchar*)pValue; @@ -170,7 +159,7 @@ set_split_reconcile_state( gpointer pObject, /*@ null @*/ gpointer pValue ) } static void -set_split_lot( gpointer pObject, /*@ null @*/ gpointer pLot ) +set_split_lot( gpointer pObject, gpointer pLot ) { GNCLot* lot; Split* split; @@ -187,7 +176,7 @@ set_split_lot( gpointer pObject, /*@ null @*/ gpointer pLot ) gnc_lot_add_split( lot, split ); } -static /*@ null @*/ Split* +static Split* load_single_split( GncSqlBackend* be, GncSqlRow* row ) { const GncGUID* guid; @@ -280,7 +269,7 @@ load_splits_for_tx_list( GncSqlBackend* be, GList* list ) (void)g_string_free( sql, TRUE ); } -static /*@ null @*/ Transaction* +static Transaction* load_single_tx( GncSqlBackend* be, GncSqlRow* row ) { const GncGUID* guid; @@ -325,7 +314,7 @@ load_single_tx( GncSqlBackend* be, GncSqlRow* row ) */ typedef struct { - /*@ dependent @*/ Account* acc; + Account* acc; gnc_numeric start_bal; gnc_numeric end_bal; gnc_numeric start_cleared_bal; @@ -1078,7 +1067,7 @@ typedef struct #define TX_GUID_CHECK 0 -G_GNUC_UNUSED static /*@ null @*/ gpointer +G_GNUC_UNUSED static gpointer compile_split_query( GncSqlBackend* be, QofQuery* query ) { split_query_info_t* query_info = NULL; @@ -1269,8 +1258,7 @@ free_split_query( GncSqlBackend* be, gpointer pQuery ) /* ----------------------------------------------------------------- */ typedef struct { - /*@ dependent @*/ const GncSqlBackend* be; - /*@ dependent @*/ + const GncSqlBackend* be; Account* acct; char reconcile_state; gnc_numeric balance; @@ -1312,15 +1300,13 @@ set_acct_bal_balance( gpointer pObject, gnc_numeric value ) static const GncSqlColumnTableEntry acct_balances_col_table[] = { - /*@ -full_init_block @*/ { "account_guid", CT_GUID, 0, 0, NULL, NULL, NULL, (QofSetterFunc)set_acct_bal_account_from_guid }, { "reconcile_state", CT_STRING, 1, 0, NULL, NULL, NULL, (QofSetterFunc)set_acct_bal_reconcile_state }, { "quantity", CT_NUMERIC, 0, 0, NULL, NULL, NULL, (QofSetterFunc)set_acct_bal_balance }, { NULL } - /*@ +full_init_block @*/ }; -G_GNUC_UNUSED static /*@ null @*/ single_acct_balance_t* +G_GNUC_UNUSED static single_acct_balance_t* load_single_acct_balances( const GncSqlBackend* be, GncSqlRow* row ) { single_acct_balance_t* bal = NULL; @@ -1337,7 +1323,7 @@ load_single_acct_balances( const GncSqlBackend* be, GncSqlRow* row ) return bal; } -/*@ null @*/ GSList* + GSList* gnc_sql_get_account_balances_slist( GncSqlBackend* be ) { #if LOAD_TRANSACTIONS_AS_NEEDED @@ -1429,7 +1415,7 @@ gnc_sql_get_account_balances_slist( GncSqlBackend* be ) /* ----------------------------------------------------------------- */ static void load_tx_guid( const GncSqlBackend* be, GncSqlRow* row, - /*@ null @*/ QofSetterFunc setter, gpointer pObject, + QofSetterFunc setter, gpointer pObject, const GncSqlColumnTableEntry* table_row ) { const GValue* val; diff --git a/src/backend/sql/gnc-transaction-sql.h b/src/backend/sql/gnc-transaction-sql.h index 29010594f1..d2332fb733 100644 --- a/src/backend/sql/gnc-transaction-sql.h +++ b/src/backend/sql/gnc-transaction-sql.h @@ -85,7 +85,6 @@ typedef struct * @param be SQL backend * @return GSList of acct_balances_t structures */ -/*@ null @*/ GSList* gnc_sql_get_account_balances_slist( GncSqlBackend* be ); #endif /* GNC_TRANSACTION_SQL_H */