[Gnucash-changes] Heath Martin's x86_64 patch.
Derek Atkins
warlord at cvs.gnucash.org
Sun Oct 31 20:37:12 EST 2004
Log Message:
-----------
Heath Martin's x86_64 patch.
* macros/autogen.sh:
change "head -1" to "head -n 1"
* src/engine/gnc-numeric.[ch]:
change string_to_gnc_numeric() to return gboolean.
* src/app-utils/gnc-exp-parser.c:
* src/backend/file/sixtp-dom-parsers.c:
use new string_to_gnc_numeric() API
* src/engine/gnc-lot.c:
64-bit safe for x86_64
* src/gnome/dialog-scheduledxaction.c:
* src/gnome/dialog-sxsincelast.c:
* src/gnome/druid-loan.c:
* src/gnome-utils/dialog-account.c:
* src/gnome-utils/gnc-query-list.c:
* src/import-export/import-match-map.c:
use GPOINTER_TO_INT and GINT_TO_POINTER macros to be 64-bit safe.
Modified Files:
--------------
gnucash:
ChangeLog
gnucash/macros:
autogen.sh
gnucash/src/app-utils:
gnc-exp-parser.c
gnucash/src/backend/file:
sixtp-dom-parsers.c
gnucash/src/engine:
gnc-lot.c
gnc-numeric.c
gnc-numeric.h
gnucash/src/gnome:
dialog-scheduledxaction.c
dialog-sxsincelast.c
druid-loan.c
gnucash/src/gnome-utils:
dialog-account.c
gnc-query-list.c
gnucash/src/import-export:
import-match-map.c
Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1852
retrieving revision 1.1853
diff -LChangeLog -LChangeLog -u -r1.1852 -r1.1853
--- ChangeLog
+++ ChangeLog
@@ -5,6 +5,24 @@
* src/engine/gnc-pricedb.c:
Phil Longstaff's patch to prevent duplicate pricedb entries.
+ Heath Martin's x86_64 patch:
+ * macros/autogen.sh:
+ change "head -1" to "head -n 1"
+ * src/engine/gnc-numeric.[ch]:
+ change string_to_gnc_numeric() to return gboolean.
+ * src/app-utils/gnc-exp-parser.c:
+ * src/backend/file/sixtp-dom-parsers.c:
+ use new string_to_gnc_numeric() API
+ * src/engine/gnc-lot.c:
+ 64-bit safe for x86_64
+ * src/gnome/dialog-scheduledxaction.c:
+ * src/gnome/dialog-sxsincelast.c:
+ * src/gnome/druid-loan.c:
+ * src/gnome-utils/dialog-account.c:
+ * src/gnome-utils/gnc-query-list.c:
+ * src/import-export/import-match-map.c:
+ use GPOINTER_TO_INT and GINT_TO_POINTER macros to be 64-bit safe.
+
2004-10-30 Christian Stimming <stimming at tuhh.de>
* doc/README.HBCI: Updated HBCI readme.
Index: autogen.sh
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/macros/autogen.sh,v
retrieving revision 1.22
retrieving revision 1.23
diff -Lmacros/autogen.sh -Lmacros/autogen.sh -u -r1.22 -r1.23
--- macros/autogen.sh
+++ macros/autogen.sh
@@ -21,7 +21,7 @@
this_prog="$1"
want_vers="$2"
- testv=`"$this_prog" --version 2>/dev/null | head -1 | awk '{print $NF}'`
+ testv=`"$this_prog" --version 2>/dev/null | head -n 1 | awk '{print $NF}'`
if test -z "$testv" ; then return 1 ; fi
testv_major=`echo "$testv" | sed 's/\([0-9]*\).\([0-9]*\).*$/\1/'`
Index: gnc-exp-parser.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/gnc-exp-parser.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lsrc/app-utils/gnc-exp-parser.c -Lsrc/app-utils/gnc-exp-parser.c -u -r1.7 -r1.8
--- src/app-utils/gnc-exp-parser.c
+++ src/app-utils/gnc-exp-parser.c
@@ -108,12 +108,12 @@
else if (SCM_STRINGP (val_scm))
{
char *s;
- const char *err;
+ gboolean err;
s = gh_scm2newstr (val_scm, NULL);
err = string_to_gnc_numeric (s, &value);
- if (err == NULL)
+ if (err == FALSE)
good = FALSE;
free (s);
Index: sixtp-dom-parsers.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/sixtp-dom-parsers.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lsrc/backend/file/sixtp-dom-parsers.c -Lsrc/backend/file/sixtp-dom-parsers.c -u -r1.17 -r1.18
--- src/backend/file/sixtp-dom-parsers.c
+++ src/backend/file/sixtp-dom-parsers.c
@@ -479,7 +479,7 @@
ret = g_new(gnc_numeric, 1);
- if(string_to_gnc_numeric(content, ret) != NULL)
+ if(string_to_gnc_numeric(content, ret))
{
g_free(content);
return ret;
Index: gnc-numeric.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/gnc-numeric.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -Lsrc/engine/gnc-numeric.c -Lsrc/engine/gnc-numeric.c -u -r1.59 -r1.60
--- src/engine/gnc-numeric.c
+++ src/engine/gnc-numeric.c
@@ -1204,32 +1204,32 @@
return p;
}
-const gchar *
+gboolean
string_to_gnc_numeric(const gchar* str, gnc_numeric *n)
{
size_t num_read;
long long int tmpnum;
long long int tmpdenom;
- if(!str) return NULL;
+ if(!str) return FALSE;
#ifdef GNC_DEPRECATED
/* must use "<" here because %n's effects aren't well defined */
if(sscanf(str, " " GNC_SCANF_LLD "/" GNC_SCANF_LLD "%n",
&tmpnum, &tmpdenom, &num_read) < 2) {
- return(NULL);
+ return FALSE;
}
#else
tmpnum = strtoll (str, NULL, 0);
str = strchr (str, '/');
- if (!str) return NULL;
+ if (!str) return FALSE;
str ++;
tmpdenom = strtoll (str, NULL, 0);
num_read = strspn (str, "0123456789");
#endif
n->num = tmpnum;
n->denom = tmpdenom;
- return(str + num_read);
+ return TRUE;
}
/********************************************************************
Index: gnc-lot.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/gnc-lot.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -Lsrc/engine/gnc-lot.c -Lsrc/engine/gnc-lot.c -u -r1.39 -r1.40
--- src/engine/gnc-lot.c
+++ src/engine/gnc-lot.c
@@ -308,7 +308,7 @@
Timespec ts;
Split *earliest = NULL;
- ts.tv_sec = 1000000LL * ((long long) LONG_MAX);
+ ts.tv_sec = ((long long) LONG_MAX);
ts.tv_nsec = 0;
if (!lot) return NULL;
@@ -337,7 +337,7 @@
Timespec ts;
Split *latest = NULL;
- ts.tv_sec = -1000000LL * ((long long) LONG_MAX);
+ ts.tv_sec = -((long long) LONG_MAX);
ts.tv_nsec = 0;
if (!lot) return NULL;
Index: gnc-numeric.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/gnc-numeric.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -Lsrc/engine/gnc-numeric.h -Lsrc/engine/gnc-numeric.h -u -r1.22 -r1.23
--- src/engine/gnc-numeric.h
+++ src/engine/gnc-numeric.h
@@ -301,10 +301,10 @@
gnc_numeric double_to_gnc_numeric(double in, gint64 denom,
gint how);
-/** Read a gnc_numeric from str, skipping any leading whitespace,
- * and return a pointer to just past the last byte read.
+/** Read a gnc_numeric from str, skipping any leading whitespace.
+ * Return TRUE on success and store the resulting value in "n".
* Return NULL on error. */
-const gchar *string_to_gnc_numeric(const gchar* str, gnc_numeric *n);
+gboolean string_to_gnc_numeric(const gchar* str, gnc_numeric *n);
/** Create a gnc_numeric object that signals the error condition
* noted by error_code, rather than a number.
Index: druid-loan.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/druid-loan.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lsrc/gnome/druid-loan.c -Lsrc/gnome/druid-loan.c -u -r1.23 -r1.24
--- src/gnome/druid-loan.c
+++ src/gnome/druid-loan.c
@@ -2585,8 +2585,8 @@
RevRepaymentRow *rrr = g_new0( RevRepaymentRow, 1 );
if ( !key || !val ) {
DEBUG( "%.8x, %.8x",
- (unsigned int)key,
- (unsigned int)val );
+ GPOINTER_TO_UINT(key),
+ GPOINTER_TO_UINT(val));
return;
}
rrr->date = *(GDate*)key;
Index: dialog-sxsincelast.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-sxsincelast.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -Lsrc/gnome/dialog-sxsincelast.c -Lsrc/gnome/dialog-sxsincelast.c -u -r1.75 -r1.76
--- src/gnome/dialog-sxsincelast.c
+++ src/gnome/dialog-sxsincelast.c
@@ -1327,7 +1327,7 @@
toDelPtr;
toDelPtr = toDelPtr->next ) {
- row = (gint)toDelPtr->data;
+ row = GPOINTER_TO_INT(toDelPtr->data);
tdt = (toDeleteTuple*)gtk_clist_get_row_data( cl, row );
elt = g_list_find( sxList, tdt->sx );
sxList = g_list_remove_link( sxList, elt );
@@ -2983,7 +2983,7 @@
print_vars_helper( gpointer key, gpointer value, gpointer user_data )
{
DEBUG( "\"%s\" -> %.8x [%s]",
- (gchar*)key, (unsigned int)value,
+ (gchar*)key, GPOINTER_TO_UINT(value),
gnc_numeric_to_string( *(gnc_numeric*)value ) );
}
Index: dialog-scheduledxaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-scheduledxaction.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -Lsrc/gnome/dialog-scheduledxaction.c -Lsrc/gnome/dialog-scheduledxaction.c -u -r1.79 -r1.80
--- src/gnome/dialog-scheduledxaction.c
+++ src/gnome/dialog-scheduledxaction.c
@@ -1770,7 +1770,7 @@
sxd = (SchedXactionDialog*)d;
cl = GTK_CLIST(glade_xml_get_widget( sxd->gxml, SX_LIST ));
for( sel = cl->selection; sel; sel = g_list_next(sel) ) {
- row = (int)sel->data;
+ row = GPOINTER_TO_INT(sel->data);
/* get the clist row for this listitem */
sx = (SchedXaction*)gtk_clist_get_row_data( cl, row );
/* get the object UD */
@@ -1807,7 +1807,7 @@
realConfDelOpenMsg = g_string_new( beingEditedMessage );
beingEditedList = NULL;
for ( ; sel ; sel = sel->next ) {
- sx = (SchedXaction*)gtk_clist_get_row_data( cl, (int)sel->data );
+ sx = (SchedXaction*)gtk_clist_get_row_data( cl, GPOINTER_TO_INT(sel->data));
g_string_sprintfa( realConfDeleteMsg, "\n\"%s\"",
xaccSchedXactionGetName( sx ) );
if ( (l = gnc_find_gui_components( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
@@ -1870,7 +1870,7 @@
gpointer unused;
gboolean foundP;
- sx = (SchedXaction*)gtk_clist_get_row_data( cl, (int)sel->data );
+ sx = (SchedXaction*)gtk_clist_get_row_data( cl, GPOINTER_TO_INT(sel->data));
sxList = g_list_remove( sxList, (gpointer)sx );
foundP = g_hash_table_lookup_extended( sxd->sxData, sx,
&unused,
@@ -1891,7 +1891,7 @@
sel = g_list_reverse( sel );
gtk_clist_unselect_all( cl );
for ( ; sel; sel = sel->next ) {
- gtk_clist_remove( cl, (int)sel->data );
+ gtk_clist_remove( cl, GPOINTER_TO_INT(sel->data) );
}
g_list_free( sel );
sel = NULL;
Index: dialog-account.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/dialog-account.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lsrc/gnome-utils/dialog-account.c -Lsrc/gnome-utils/dialog-account.c -u -r1.11 -r1.12
--- src/gnome-utils/dialog-account.c
+++ src/gnome-utils/dialog-account.c
@@ -1148,7 +1148,7 @@
{
text[0] = (gchar *) xaccAccountGetTypeStr(acct_type);
row = gtk_clist_append(type_list, text);
- gtk_clist_set_row_data(type_list, row, (gpointer)acct_type);
+ gtk_clist_set_row_data(type_list, row, GINT_TO_POINTER(acct_type));
}
}
else
@@ -1171,7 +1171,7 @@
if (aw->valid_types == NULL)
return last_used_account_type;
- if (g_list_index (aw->valid_types, (gpointer)last_used_account_type) != -1)
+ if (g_list_index (aw->valid_types, GINT_TO_POINTER(last_used_account_type)) != -1)
return last_used_account_type;
return ((GNCAccountType)(aw->valid_types->data));
Index: gnc-query-list.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/gnc-query-list.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lsrc/gnome-utils/gnc-query-list.c -Lsrc/gnome-utils/gnc-query-list.c -u -r1.11 -r1.12
--- src/gnome-utils/gnc-query-list.c
+++ src/gnome-utils/gnc-query-list.c
@@ -178,7 +178,7 @@
if (safe_strcmp (type, QUERYCORE_BOOLEAN))
continue;
- result = (gboolean)(gnc_search_param_compute_value(param, entry));
+ result = (gboolean) GPOINTER_TO_INT(gnc_search_param_compute_value(param, entry));
gnc_clist_set_check (clist, row, i, result);
}
}
Index: import-match-map.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/import-match-map.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lsrc/import-export/import-match-map.c -Lsrc/import-export/import-match-map.c -u -r1.7 -r1.8
--- src/import-export/import-match-map.c
+++ src/import-export/import-match-map.c
@@ -238,7 +238,7 @@
PINFO("P('%s') = '%d'\n", (char*)key, probability);
- g_hash_table_insert(final_probabilities, key, (gpointer)probability);
+ g_hash_table_insert(final_probabilities, key, GINT_TO_POINTER(probability));
}
/** Frees an array of the same time that buildProperties built */
@@ -270,10 +270,10 @@
struct account_info *account_i = (struct account_info*)data;
/* if the current probability is greater than the stored, store the current */
- if((gint32)value > account_i->probability)
+ if(GPOINTER_TO_INT(value) > account_i->probability)
{
/* Save the new highest probability and the assoaciated account name */
- account_i->probability = (gint32)value;
+ account_i->probability = GPOINTER_TO_INT(value);
account_i->account_name = key;
}
}
More information about the gnucash-changes
mailing list