[Planner Dev] Patch to remove old mrp-sql.c crud.




Recent changes to makefiles now mean mrp-sql.c will
not build due to old crud left in file.

This patches mrp-sql v1.6


Index: libplanner/mrp-sql.c
===================================================================
RCS file: /cvs/gnome/planner/libplanner/mrp-sql.c,v
retrieving revision 1.6
diff -u -b -B -p -r1.6 mrp-sql.c
--- a/libplanner/mrp-sql.c	17 Apr 2004 15:26:08 -0000	1.6
+++ b/libplanner/mrp-sql.c	3 May 2004 11:59:10 -0000
@@ -180,8 +180,6 @@ static gboolean sql_write_tasks         
 static GdaDataModel * 
                 sql_execute_query             (GdaConnection        *con, 
 					       gchar                *query);
-static char *   sql_get_errors                (GdaConnection        *connection);
-static void     sql_show_result               (GdaDataModel         *res);
 
 #define STOP_ON_ERR     GDA_COMMAND_OPTION_STOP_ON_ERRORS
 
@@ -197,32 +195,11 @@ sql_execute_query (GdaConnection *con, g
 	return res;
 }
 
-static gchar *
-sql_get_errors (GdaConnection *connection)
-{
-        GList    *list;
-        GList    *node;
-        GdaError *error;
-	gchar    *error_txt;
-      
-        list = (GList *) gda_connection_get_errors (connection);
-      
-        for (node = g_list_first (list); node != NULL; node = g_list_next (node)) {
-		error = (GdaError *) node->data;
-		g_print ("Error no: %d\t", gda_error_get_number (error));
-		g_print ("desc: %s\t", gda_error_get_description (error));
-		g_print ("source: %s\t", gda_error_get_source (error));
-		g_print ("sqlstate: %s\n", gda_error_get_sqlstate (error));
-		error_txt = g_strdup_printf ("Desc. error: %s", gda_error_get_description (error));
-	}
-	return error_txt;
-}
 
 static const gchar *
 sql_get_last_error (GdaConnection *connection)
 {
 	GList       *list;
-	GList       *node;
 	GdaError    *error;
 	const gchar *error_txt;
 
@@ -232,40 +209,12 @@ sql_get_last_error (GdaConnection *conne
 
 	error = (GdaError *) g_list_last (list)->data;
       
-	/* Poor user, she won't get localized messages */
+	/* Poor user, they won't get localized messages */
 	error_txt = gda_error_get_description (error);
 
 	return error_txt;
 }
 
-void
-sql_show_result (GdaDataModel * dm)
-{
-	gint      row_id;
-	gint      column_id;
-	GdaValue *value;
-	gchar    *string;
-	
-	for (column_id = 0; column_id < gda_data_model_get_n_columns (dm);
-	     column_id++) {
-		g_print ("%s\t", gda_data_model_get_column_title (dm, column_id));
-	}
-	g_print ("\n");
-	
-	for (row_id = 0; row_id < gda_data_model_get_n_rows (dm); row_id++) {
-		for (column_id = 0; column_id < gda_data_model_get_n_columns (dm);
-		     column_id++) {
-			value = (GdaValue *) 
-				gda_data_model_get_value_at (dm, column_id, row_id);
-			string = gda_value_stringify (value);
-			g_print ("%s\t", string);
-			g_free (string);
-		}
-		g_print ("\n");
-	}
-}
-
-
 
 static gint
 get_int (GdaDataModel *res, gint row, gint column)
@@ -273,7 +222,7 @@ get_int (GdaDataModel *res, gint row, gi
 	const gchar    *str;
 	const GdaValue *value;
 	
-	g_return_if_fail (GDA_IS_DATA_MODEL (res));
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (res), INT_MAX);
 	
 	value = (GdaValue *) gda_data_model_get_value_at (res, column, row);
 	if (value == NULL) {
@@ -291,7 +240,7 @@ get_id (GdaDataModel *res, gint row, gin
 	const gchar    *str;
 	const GdaValue *value;
 	
-	g_return_if_fail (GDA_IS_DATA_MODEL (res));
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (res), INT_MAX);
 
 	value = (GdaValue *) gda_data_model_get_value_at (res, column, row);
 	if (value == NULL) {
@@ -316,7 +265,7 @@ get_string (GdaDataModel *res, gint row,
 	gsize           len;
 	const GdaValue *value;
 	
-	g_return_if_fail (GDA_IS_DATA_MODEL (res));
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (res), "");
 
 	value = (GdaValue *) gda_data_model_get_value_at (res, column, row);
 	if (value == NULL) {
@@ -352,9 +301,8 @@ static gboolean
 get_boolean (GdaDataModel *res, gint row, gint column)
 {
 	const GdaValue *value;
-	gboolean       *boolean;
 	
-	g_return_if_fail (GDA_IS_DATA_MODEL (res));
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (res), -1);
 
 	value = (GdaValue *) gda_data_model_get_value_at (res, column, row);
 	if (value == NULL) {
@@ -372,7 +320,7 @@ get_float (GdaDataModel *res, gint row, 
 	const gchar    *str;
 	const GdaValue *value;
 	
-	g_return_if_fail (GDA_IS_DATA_MODEL (res));
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (res), -1);
 
 	value = (GdaValue *) gda_data_model_get_value_at (res, column, row);
 
@@ -2184,11 +2132,8 @@ mrp_sql_load_project (MrpStorageSQL *sto
 		      GError       **error)
 {
 	SQLData        *data;
-	gchar          *pgoptions = NULL;
-	gchar          *pgtty = NULL;
 	GdaDataModel   *res = NULL;
 	GdaClient      *client;
-	gchar          *str;
 	const gchar    *dsn_name = "planner-auto";
 	gchar          *db_txt;
 	MrpCalendar    *calendar;
@@ -3629,8 +3574,6 @@ mrp_sql_save_project (MrpStorageSQL  *st
 		      GError        **error)
 {
 	SQLData      *data;
-	gchar        *pgoptions = NULL;
-	gchar        *pgtty = NULL;
 	gchar        *db_txt = NULL;
 	const gchar  *dsn_name = "planner-auto";
 	GdaDataModel *res = NULL;



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