[PATCH] databases/libgda2: [Fix build on FreeBSD 4.x]

Tod McQuillin devin at spamcop.net
Sun Mar 26 01:41:45 UTC 2006


>Submitter-Id:	current-users
>Originator:	Tod McQuillin
>Organization:	
>Confidential:	no 
>Synopsis:	[PATCH] databases/libgda2: [Fix build on FreeBSD 4.x]
>Severity:	non-critical
>Priority:	low
>Category:	ports 
>Class:		change-request
>Release:	FreeBSD 4.11-STABLE i386
>Environment:
System: FreeBSD plexi.pun-pun.prv 4.11-STABLE FreeBSD 4.11-STABLE #0: Thu Mar 23 21:52:12 JST 2006
>Description:
Fix several C99isms so that the code will compile on FreeBSD 4.x
which uses gcc 2.95.

In libgda/gda-query-target.c move a variable declaration to the
top of the block.

In libgda/handlers/gda-handler-numerical.c,
providers/ibmdb2/gda-ibmdb2-types.c,
providers/mysql/gda-mysql-recordset.c, providers/oracle/utils.c,
change calls to atoll() to use strtoll() instead, which is supported
on FreeBSD 4.x.

Added file(s):
- files/patch-libgda_gda-query-target.c
- files/patch-libgda_handlers_gda-handler-numerical.c
- files/patch-providers_ibmdb2_gda-ibmdb2-types.c
- files/patch-providers_oracle_utils.c

Port maintainer (gnome at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- libgda2-1.9.102.patch begins here ---
Index: files/patch-libgda_gda-query-target.c
===================================================================
RCS file: files/patch-libgda_gda-query-target.c
diff -N files/patch-libgda_gda-query-target.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-libgda_gda-query-target.c	26 Mar 2006 01:26:22 -0000
@@ -0,0 +1,12 @@
+--- libgda/gda-query-target.c~	Mon Jan 23 00:18:37 2006
++++ libgda/gda-query-target.c	Sun Mar 26 10:03:52 2006
+@@ -732,8 +732,8 @@
+ 	g_free (str);
+ 	
+ 	if (target->priv->entity_ref) {
+-		str = NULL;
+ 		GdaObject *base = gda_object_ref_get_ref_object (target->priv->entity_ref);
++		str = NULL;
+ 
+ 		if (base) {
+ 			str = gda_xml_storage_get_xml_id (GDA_XML_STORAGE (base));
Index: files/patch-libgda_handlers_gda-handler-numerical.c
===================================================================
RCS file: files/patch-libgda_handlers_gda-handler-numerical.c
diff -N files/patch-libgda_handlers_gda-handler-numerical.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-libgda_handlers_gda-handler-numerical.c	26 Mar 2006 01:25:41 -0000
@@ -0,0 +1,11 @@
+--- libgda/handlers/gda-handler-numerical.c~	Mon Jan 23 02:57:38 2006
++++ libgda/handlers/gda-handler-numerical.c	Sun Mar 26 10:18:42 2006
+@@ -231,7 +231,7 @@
+ 
+ 	switch (type) {
+ 	case GDA_VALUE_TYPE_BIGINT:
+-		value = gda_value_new_bigint (atoll (str));
++		value = gda_value_new_bigint (strtoll (str, (char **)NULL, 10));
+ 		break;
+ 	case GDA_VALUE_TYPE_DOUBLE:
+ 		value = gda_value_new_double (atof (str));
Index: files/patch-providers__mysql__gda-mysql-recordset.c
===================================================================
RCS file: /usr/src/cvs-repo/ports/databases/libgda2/files/patch-providers__mysql__gda-mysql-recordset.c,v
retrieving revision 1.1
diff -u -u -r1.1 patch-providers__mysql__gda-mysql-recordset.c
--- files/patch-providers__mysql__gda-mysql-recordset.c	8 Nov 2005 07:32:39 -0000	1.1
+++ files/patch-providers__mysql__gda-mysql-recordset.c	26 Mar 2006 01:28:45 -0000
@@ -1,6 +1,15 @@
---- ../../work-/libgda-1.9.100/providers/mysql/gda-mysql-recordset.c	Tue Nov  8 14:56:45 2005
-+++ providers/mysql/gda-mysql-recordset.c	Tue Nov  8 14:59:26 2005
-@@ -569,6 +569,7 @@
+--- providers/mysql/gda-mysql-recordset.c.orig	Thu Mar  2 22:28:54 2006
++++ providers/mysql/gda-mysql-recordset.c	Sun Mar 26 10:20:02 2006
+@@ -141,7 +141,7 @@
+ 		if (is_unsigned) {
+ 			gda_value_set_biguint (gda_value, strtoull (value, NULL, 0));
+ 		} else {
+-			gda_value_set_bigint (gda_value, atoll (value));
++			gda_value_set_bigint (gda_value, strtoll (value, (char **)NULL, 0));
+ 		}
+ 		break;
+ 	case FIELD_TYPE_SHORT :
+@@ -584,6 +584,7 @@
  	     colnum != gda_data_model_get_n_columns (GDA_DATA_MODEL(model));
  	     colnum++)
  	{
@@ -8,7 +17,7 @@
  		attrs = gda_data_model_describe_column (GDA_DATA_MODEL(model), colnum);
  
  		mysql_field = mysql_fetch_field_direct (priv_data->mysql_res, colnum);
-@@ -577,7 +578,7 @@
+@@ -592,7 +593,7 @@
  		else
  			column_name = gda_data_model_get_column_title (GDA_DATA_MODEL (model), colnum);
  
Index: files/patch-providers_ibmdb2_gda-ibmdb2-types.c
===================================================================
RCS file: files/patch-providers_ibmdb2_gda-ibmdb2-types.c
diff -N files/patch-providers_ibmdb2_gda-ibmdb2-types.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-providers_ibmdb2_gda-ibmdb2-types.c	26 Mar 2006 01:26:56 -0000
@@ -0,0 +1,11 @@
+--- providers/ibmdb2/gda-ibmdb2-types.c~	Thu Jan 12 07:10:33 2006
++++ providers/ibmdb2/gda-ibmdb2-types.c	Sun Mar 26 10:19:26 2006
+@@ -115,7 +115,7 @@
+ 				gda_value_set_integer (value, *((gint*)field->column_data));
+ 				break;
+ 			case SQL_BIGINT:
+-				gda_value_set_bigint (value, (gint64)atoll(field->column_data));
++				gda_value_set_bigint (value, (gint64)strtoll(field->column_data, (char **)NULL, 10));
+ 				break;
+ 			case SQL_REAL:
+ 				gda_value_set_single (value, *((gfloat*)field->column_data));
Index: files/patch-providers_oracle_utils.c
===================================================================
RCS file: files/patch-providers_oracle_utils.c
diff -N files/patch-providers_oracle_utils.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-providers_oracle_utils.c	26 Mar 2006 01:29:09 -0000
@@ -0,0 +1,11 @@
+--- providers/oracle/utils.c~	Wed Mar 15 07:25:51 2006
++++ providers/oracle/utils.c	Sun Mar 26 10:20:18 2006
+@@ -415,7 +415,7 @@
+ 		g_free (string_buffer);
+ 		break;
+ 	case GDA_VALUE_TYPE_BIGINT:
+-		gda_value_set_bigint (value, atoll (ora_value->value));
++		gda_value_set_bigint (value, strtoll (ora_value->value, (char **)NULL, 10));
+ 		break;
+ 	case GDA_VALUE_TYPE_INTEGER:
+ 		gda_value_set_integer (value, atol (ora_value->value));
--- libgda2-1.9.102.patch ends here ---



More information about the freebsd-gnome mailing list