mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Guile 2: replace deprecated functions
These are all simple one to one mappings. The replacements require guile 1.8 or newer. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22652 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
37b65abff1
commit
bf896bcdfa
@ -311,11 +311,11 @@ func_op(const char *fname, int argc, void **argv)
|
||||
{
|
||||
case VST_NUMERIC:
|
||||
n = *(gnc_numeric*)(vs->value);
|
||||
scmTmp = scm_make_real( gnc_numeric_to_double( n ) );
|
||||
scmTmp = scm_from_double ( gnc_numeric_to_double( n ) );
|
||||
break;
|
||||
case VST_STRING:
|
||||
str = (char*)(vs->value);
|
||||
scmTmp = scm_mem2string( str, strlen(str) );
|
||||
scmTmp = scm_from_locale_string( str );
|
||||
break;
|
||||
default:
|
||||
/* FIXME: error */
|
||||
@ -337,7 +337,7 @@ func_op(const char *fname, int argc, void **argv)
|
||||
}
|
||||
|
||||
result = g_new0( gnc_numeric, 1 );
|
||||
*result = double_to_gnc_numeric( scm_num2dbl(scmTmp, G_STRFUNC),
|
||||
*result = double_to_gnc_numeric( scm_to_double(scmTmp),
|
||||
GNC_DENOM_AUTO,
|
||||
GNC_HOW_DENOM_SIGFIGS(6) | GNC_HOW_RND_ROUND_HALF_UP );
|
||||
/* FIXME: cleanup scmArgs = scm_list, cons'ed cells? */
|
||||
|
@ -47,12 +47,12 @@ gnc_printinfo2scm(GNCPrintAmountInfo info)
|
||||
info_scm = scm_cons (SCM_BOOL (info.use_symbol), info_scm);
|
||||
info_scm = scm_cons (SCM_BOOL (info.use_separators), info_scm);
|
||||
|
||||
info_scm = scm_cons (scm_int2num (info.min_decimal_places), info_scm);
|
||||
info_scm = scm_cons (scm_int2num (info.max_decimal_places), info_scm);
|
||||
info_scm = scm_cons (scm_from_int (info.min_decimal_places), info_scm);
|
||||
info_scm = scm_cons (scm_from_int (info.max_decimal_places), info_scm);
|
||||
|
||||
info_scm = scm_cons (gnc_commodity_to_scm (info.commodity), info_scm);
|
||||
|
||||
info_scm = scm_cons (scm_str2symbol ("print-info"), info_scm);
|
||||
info_scm = scm_cons (scm_from_locale_symbol ("print-info"), info_scm);
|
||||
|
||||
return info_scm;
|
||||
}
|
||||
@ -67,12 +67,10 @@ gnc_scm2printinfo(SCM info_scm)
|
||||
info.commodity = gnc_scm_to_commodity (SCM_CAR (info_scm));
|
||||
|
||||
info_scm = SCM_CDR (info_scm);
|
||||
info.max_decimal_places = scm_num2int (SCM_CAR (info_scm), SCM_ARG1,
|
||||
G_STRFUNC);
|
||||
info.max_decimal_places = scm_to_int (SCM_CAR (info_scm));
|
||||
|
||||
info_scm = SCM_CDR (info_scm);
|
||||
info.min_decimal_places = scm_num2int (SCM_CAR (info_scm), SCM_ARG1,
|
||||
G_STRFUNC);
|
||||
info.min_decimal_places = scm_to_int (SCM_CAR (info_scm));
|
||||
|
||||
info_scm = SCM_CDR (info_scm);
|
||||
info.use_separators = scm_is_true (SCM_CAR (info_scm));
|
||||
|
@ -392,7 +392,7 @@ gnc_ui_account_get_tax_info_string (const Account *account)
|
||||
{
|
||||
SCM code_scm;
|
||||
SCM form_scm;
|
||||
code_scm = scm_str2symbol (code);
|
||||
code_scm = scm_from_locale_symbol (code);
|
||||
form_scm = scm_call_3 (get_form, category, code_scm, tax_entity_type);
|
||||
if (!scm_is_string (form_scm))
|
||||
{
|
||||
|
@ -1023,7 +1023,7 @@ gnc_trans_scm_get_split_scm(SCM trans_scm, int index)
|
||||
if (!gnc_is_trans_scm(trans_scm))
|
||||
return SCM_UNDEFINED;
|
||||
|
||||
arg = scm_int2num(index);
|
||||
arg = scm_from_int (index);
|
||||
|
||||
return scm_call_2(getters.trans_scm_split_scm, trans_scm, arg);
|
||||
}
|
||||
@ -1105,7 +1105,7 @@ gnc_get_debit_string(GNCAccountType account_type)
|
||||
if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
|
||||
account_type = ACCT_TYPE_NONE;
|
||||
|
||||
arg = scm_long2num(account_type);
|
||||
arg = scm_from_long (account_type);
|
||||
|
||||
result = scm_call_1(getters.debit_string, arg);
|
||||
if (!scm_is_string(result))
|
||||
@ -1136,7 +1136,7 @@ gnc_get_credit_string(GNCAccountType account_type)
|
||||
if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
|
||||
account_type = ACCT_TYPE_NONE;
|
||||
|
||||
arg = scm_long2num(account_type);
|
||||
arg = scm_from_long (account_type);
|
||||
|
||||
result = scm_call_1(getters.credit_string, arg);
|
||||
if (!scm_is_string(result))
|
||||
|
@ -190,7 +190,7 @@ gnc_option_db_init(GNCOptionDB *odb)
|
||||
{
|
||||
SCM func = scm_c_eval_string("gnc:send-options");
|
||||
|
||||
scm_call_2(func, scm_int2num(odb->handle), odb->guile_options);
|
||||
scm_call_2(func, scm_from_int (odb->handle), odb->guile_options);
|
||||
}
|
||||
|
||||
|
||||
@ -825,7 +825,7 @@ gnc_option_num_permissible_values(GNCOption *option)
|
||||
|
||||
if (scm_is_exact(value))
|
||||
{
|
||||
return scm_num2int(value, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -854,7 +854,7 @@ gnc_option_permissible_value_index(GNCOption *option, SCM search_value)
|
||||
}
|
||||
else
|
||||
{
|
||||
return scm_num2int(value, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -880,7 +880,7 @@ gnc_option_permissible_value(GNCOption *option, int index)
|
||||
initialize_getters();
|
||||
|
||||
value = scm_call_2(getters.index_to_value, option->guile_option,
|
||||
scm_int2num(index));
|
||||
scm_from_int (index));
|
||||
|
||||
return value;
|
||||
}
|
||||
@ -909,7 +909,7 @@ gnc_option_permissible_value_name(GNCOption *option, int index)
|
||||
initialize_getters();
|
||||
|
||||
name = scm_call_2(getters.index_to_name, option->guile_option,
|
||||
scm_int2num(index));
|
||||
scm_from_int (index));
|
||||
if (name == SCM_UNDEFINED)
|
||||
return NULL;
|
||||
if (!scm_is_string(name))
|
||||
@ -948,7 +948,7 @@ gnc_option_permissible_value_description(GNCOption *option, int index)
|
||||
initialize_getters();
|
||||
|
||||
help = scm_call_2(getters.index_to_description, option->guile_option,
|
||||
scm_int2num(index));
|
||||
scm_from_int (index));
|
||||
if (help == SCM_UNDEFINED)
|
||||
return NULL;
|
||||
if (!scm_is_string(help))
|
||||
@ -1056,7 +1056,7 @@ gnc_option_get_account_type_list(GNCOption *option)
|
||||
}
|
||||
else
|
||||
{
|
||||
type = scm_num2long (item, SCM_ARG1, G_STRFUNC);
|
||||
type = scm_to_long (item);
|
||||
type_list = g_list_prepend (type_list, GINT_TO_POINTER (type));
|
||||
}
|
||||
}
|
||||
@ -1098,7 +1098,7 @@ gboolean gnc_option_get_range_info(GNCOption *option,
|
||||
return FALSE;
|
||||
|
||||
if (lower_bound != NULL)
|
||||
*lower_bound = scm_num2dbl(value, G_STRFUNC);
|
||||
*lower_bound = scm_to_double(value);
|
||||
|
||||
if (!scm_is_list(list) || scm_is_null(list))
|
||||
return FALSE;
|
||||
@ -1111,7 +1111,7 @@ gboolean gnc_option_get_range_info(GNCOption *option,
|
||||
return FALSE;
|
||||
|
||||
if (upper_bound != NULL)
|
||||
*upper_bound = scm_num2dbl(value, G_STRFUNC);
|
||||
*upper_bound = scm_to_double(value);
|
||||
|
||||
if (!scm_is_list(list) || scm_is_null(list))
|
||||
return FALSE;
|
||||
@ -1128,7 +1128,7 @@ gboolean gnc_option_get_range_info(GNCOption *option,
|
||||
*/
|
||||
if (num_decimals != NULL)
|
||||
{
|
||||
double decimals = scm_num2dbl(value, G_STRFUNC);
|
||||
double decimals = scm_to_double(value);
|
||||
*num_decimals = (int)decimals;
|
||||
}
|
||||
|
||||
@ -1143,7 +1143,7 @@ gboolean gnc_option_get_range_info(GNCOption *option,
|
||||
return FALSE;
|
||||
|
||||
if (step_size != NULL)
|
||||
*step_size = scm_num2dbl(value, G_STRFUNC);
|
||||
*step_size = scm_to_double(value);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1173,7 +1173,7 @@ gnc_option_color_range(GNCOption *option)
|
||||
if (!scm_is_number(value))
|
||||
return 0.0;
|
||||
|
||||
return scm_num2dbl(value, G_STRFUNC);
|
||||
return scm_to_double(value);
|
||||
}
|
||||
|
||||
|
||||
@ -1286,7 +1286,7 @@ gnc_option_get_color_info(GNCOption *option,
|
||||
|
||||
scale = 1.0 / scale;
|
||||
|
||||
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
|
||||
rgba = scm_to_double(SCM_CAR(value));
|
||||
if (red != NULL)
|
||||
*red = MIN(1.0, rgba * scale);
|
||||
|
||||
@ -1294,7 +1294,7 @@ gnc_option_get_color_info(GNCOption *option,
|
||||
if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
|
||||
return FALSE;
|
||||
|
||||
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
|
||||
rgba = scm_to_double(SCM_CAR(value));
|
||||
if (green != NULL)
|
||||
*green = MIN(1.0, rgba * scale);
|
||||
|
||||
@ -1302,7 +1302,7 @@ gnc_option_get_color_info(GNCOption *option,
|
||||
if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
|
||||
return FALSE;
|
||||
|
||||
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
|
||||
rgba = scm_to_double(SCM_CAR(value));
|
||||
if (blue != NULL)
|
||||
*blue = MIN(1.0, rgba * scale);
|
||||
|
||||
@ -1310,7 +1310,7 @@ gnc_option_get_color_info(GNCOption *option,
|
||||
if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
|
||||
return FALSE;
|
||||
|
||||
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
|
||||
rgba = scm_to_double(SCM_CAR(value));
|
||||
if (alpha != NULL)
|
||||
*alpha = MIN(1.0, rgba * scale);
|
||||
|
||||
@ -2248,7 +2248,7 @@ gnc_option_db_lookup_number_option(GNCOptionDB *odb,
|
||||
{
|
||||
value = scm_call_0(getter);
|
||||
if (scm_is_number(value))
|
||||
return scm_num2dbl(value, G_STRFUNC);
|
||||
return scm_to_double(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2503,7 +2503,7 @@ gnc_option_db_set_number_option(GNCOptionDB *odb,
|
||||
if (option == NULL)
|
||||
return FALSE;
|
||||
|
||||
scm_value = scm_make_real(value);
|
||||
scm_value = scm_from_double (value);
|
||||
|
||||
scm_value = gnc_option_valid_value(option, scm_value);
|
||||
if (scm_value == SCM_UNDEFINED)
|
||||
@ -2584,7 +2584,7 @@ gnc_option_db_set_string_option(GNCOptionDB *odb,
|
||||
return FALSE;
|
||||
|
||||
if (value)
|
||||
scm_value = scm_mem2string(value, strlen(value));
|
||||
scm_value = scm_from_locale_string(value);
|
||||
else
|
||||
scm_value = SCM_BOOL_F;
|
||||
|
||||
@ -2798,7 +2798,7 @@ SCM gnc_dateformat_option_set_value(QofDateFormat format, GNCDateMonthFormat mon
|
||||
|
||||
/* build the list in reverse order */
|
||||
if (custom)
|
||||
val = scm_mem2string(custom, strlen(custom));
|
||||
val = scm_from_locale_string(custom);
|
||||
else
|
||||
val = SCM_BOOL_F;
|
||||
value = scm_cons(val, value);
|
||||
@ -2808,14 +2808,14 @@ SCM gnc_dateformat_option_set_value(QofDateFormat format, GNCDateMonthFormat mon
|
||||
|
||||
str = gnc_date_monthformat_to_string(months);
|
||||
if (str)
|
||||
val = scm_str2symbol(str);
|
||||
val = scm_from_locale_symbol(str);
|
||||
else
|
||||
val = SCM_BOOL_F;
|
||||
value = scm_cons(val, value);
|
||||
|
||||
str = gnc_date_dateformat_to_string(format);
|
||||
if (str)
|
||||
val = scm_str2symbol(str);
|
||||
val = scm_from_locale_symbol(str);
|
||||
else
|
||||
val = SCM_BOOL_F;
|
||||
value = scm_cons(val, value);
|
||||
|
@ -19,7 +19,7 @@ typedef char gchar;
|
||||
%typemap (out) char * {
|
||||
$result = scm_makfrom0str((const char *)$1);
|
||||
if (!scm_is_true($result)) {
|
||||
$result = scm_makstr(0, 0);
|
||||
$result = scm_c_make_string(0, SCM_UNDEFINED);
|
||||
}
|
||||
}
|
||||
%typemap(in) GNCPrintAmountInfo "$1 = gnc_scm2printinfo($input);"
|
||||
|
@ -100,7 +100,7 @@ get_owner_type_from_option (GNCOption *option)
|
||||
SCM odata = gnc_option_get_option_data (option);
|
||||
|
||||
/* The option data is enum-typed. It's just the enum value. */
|
||||
return (GncOwnerType) scm_num2int(odata, SCM_ARG1, G_STRFUNC);
|
||||
return (GncOwnerType) scm_to_int(odata);
|
||||
}
|
||||
|
||||
|
||||
|
@ -651,7 +651,7 @@ gnc_invoice_window_print_invoice(GncInvoice *invoice)
|
||||
|
||||
arg = scm_apply (func, args, SCM_EOL);
|
||||
g_return_if_fail (scm_is_exact (arg));
|
||||
report_id = scm_num2int (arg, SCM_ARG1, G_STRFUNC);
|
||||
report_id = scm_to_int (arg);
|
||||
|
||||
/* scm_gc_unprotect_object(func); */
|
||||
if (report_id >= 0)
|
||||
@ -1001,7 +1001,7 @@ void gnc_business_call_owner_report (GncOwner *owner, Account *acc)
|
||||
/* Apply the function to the args */
|
||||
arg = scm_apply (func, args, SCM_EOL);
|
||||
g_return_if_fail (scm_is_exact (arg));
|
||||
id = scm_num2int (arg, SCM_ARG1, G_STRFUNC);
|
||||
id = scm_to_int (arg);
|
||||
|
||||
if (id >= 0)
|
||||
reportWindow (id);
|
||||
|
@ -941,7 +941,7 @@ build_aging_report (GncOwnerType owner_type)
|
||||
arg = scm_apply (func, args, SCM_EOL);
|
||||
g_return_val_if_fail (scm_is_exact (arg), -1);
|
||||
|
||||
return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int (arg);
|
||||
}
|
||||
|
||||
static int build_owner_report (GncOwner *owner, Account *acc)
|
||||
@ -978,7 +978,7 @@ static int build_owner_report (GncOwner *owner, Account *acc)
|
||||
/* Apply the function to the args */
|
||||
arg = scm_apply (func, args, SCM_EOL);
|
||||
g_return_val_if_fail (scm_is_exact (arg), -1);
|
||||
return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int (arg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ gnc_timespec2timepair(Timespec t)
|
||||
SCM nsecs;
|
||||
|
||||
secs = gnc_gint64_to_scm(t.tv_sec);
|
||||
nsecs = scm_long2num(t.tv_nsec);
|
||||
nsecs = scm_from_long (t.tv_nsec);
|
||||
return(scm_cons(secs, nsecs));
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ gnc_timepair2timespec(SCM x)
|
||||
if (gnc_timepair_p (x))
|
||||
{
|
||||
result.tv_sec = gnc_scm_to_gint64(SCM_CAR(x));
|
||||
result.tv_nsec = scm_num2long(SCM_CDR(x), SCM_ARG1, G_STRFUNC);
|
||||
result.tv_nsec = scm_to_long(SCM_CDR(x));
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
@ -207,42 +207,42 @@ typedef enum
|
||||
static QofQueryCompare
|
||||
gnc_query_scm2compare (SCM how_scm)
|
||||
{
|
||||
return scm_num2int(how_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(how_scm);
|
||||
}
|
||||
|
||||
/* QofStringMatch */
|
||||
static QofStringMatch
|
||||
gnc_query_scm2string (SCM how_scm)
|
||||
{
|
||||
return scm_num2int(how_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(how_scm);
|
||||
}
|
||||
|
||||
/* QofDateMatch */
|
||||
static QofDateMatch
|
||||
gnc_query_scm2date (SCM how_scm)
|
||||
{
|
||||
return scm_num2int(how_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(how_scm);
|
||||
}
|
||||
|
||||
/* QofNumericMatch */
|
||||
static QofNumericMatch
|
||||
gnc_query_scm2numericop (SCM how_scm)
|
||||
{
|
||||
return scm_num2int(how_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(how_scm);
|
||||
}
|
||||
|
||||
/* QofGuidMatch */
|
||||
static QofGuidMatch
|
||||
gnc_query_scm2guid (SCM how_scm)
|
||||
{
|
||||
return scm_num2int(how_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(how_scm);
|
||||
}
|
||||
|
||||
/* QofCharMatch */
|
||||
static QofCharMatch
|
||||
gnc_query_scm2char (SCM how_scm)
|
||||
{
|
||||
return scm_num2int(how_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(how_scm);
|
||||
}
|
||||
|
||||
static QofGuidMatch
|
||||
@ -331,7 +331,7 @@ gnc_scm2bitfield (SCM field_scm)
|
||||
scm = SCM_CAR (field_scm);
|
||||
field_scm = SCM_CDR (field_scm);
|
||||
|
||||
bit = scm_num2int(scm, SCM_ARG2, G_STRFUNC);
|
||||
bit = scm_to_int(scm);
|
||||
field |= bit;
|
||||
}
|
||||
|
||||
@ -540,7 +540,7 @@ gnc_query_path_free (GSList *path)
|
||||
static KvpValueType
|
||||
gnc_scm2KvpValueType (SCM value_type_scm)
|
||||
{
|
||||
return scm_num2int(value_type_scm, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int(value_type_scm);
|
||||
}
|
||||
|
||||
static SCM gnc_kvp_frame2scm (KvpFrame *frame);
|
||||
@ -556,7 +556,7 @@ gnc_kvp_value2scm (const KvpValue *value)
|
||||
|
||||
value_t = kvp_value_get_type (value);
|
||||
|
||||
value_scm = scm_cons (scm_long2num (value_t), value_scm);
|
||||
value_scm = scm_cons (scm_from_long (value_t), value_scm);
|
||||
|
||||
switch (value_t)
|
||||
{
|
||||
@ -565,7 +565,7 @@ gnc_kvp_value2scm (const KvpValue *value)
|
||||
break;
|
||||
|
||||
case KVP_TYPE_DOUBLE:
|
||||
scm = scm_make_real (kvp_value_get_double (value));
|
||||
scm = scm_from_double (kvp_value_get_double (value));
|
||||
break;
|
||||
|
||||
case KVP_TYPE_STRING:
|
||||
@ -679,7 +679,7 @@ gnc_scm2KvpValue (SCM value_scm)
|
||||
break;
|
||||
|
||||
case KVP_TYPE_DOUBLE:
|
||||
value = kvp_value_new_double (scm_num2dbl (val_scm, G_STRFUNC));
|
||||
value = kvp_value_new_double (scm_to_double (val_scm));
|
||||
break;
|
||||
|
||||
case KVP_TYPE_STRING:
|
||||
@ -835,14 +835,14 @@ gnc_queryterm2scm (const QofQueryTerm *qt)
|
||||
qt_scm = scm_cons (SCM_BOOL (qof_query_term_is_inverted (qt)), qt_scm);
|
||||
|
||||
pd = qof_query_term_get_pred_data (qt);
|
||||
qt_scm = scm_cons (scm_str2symbol (pd->type_name), qt_scm);
|
||||
qt_scm = scm_cons (scm_long2num (pd->how), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_locale_symbol (pd->type_name), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_long (pd->how), qt_scm);
|
||||
|
||||
if (!g_strcmp0 (pd->type_name, QOF_TYPE_STRING))
|
||||
{
|
||||
query_string_t pdata = (query_string_t) pd;
|
||||
|
||||
qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_long (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (SCM_BOOL (pdata->is_regex), qt_scm);
|
||||
qt_scm = scm_cons (scm_makfrom0str (pdata->matchstring), qt_scm);
|
||||
|
||||
@ -851,7 +851,7 @@ gnc_queryterm2scm (const QofQueryTerm *qt)
|
||||
{
|
||||
query_date_t pdata = (query_date_t) pd;
|
||||
|
||||
qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_long (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (gnc_timespec2timepair (pdata->date), qt_scm);
|
||||
|
||||
}
|
||||
@ -859,7 +859,7 @@ gnc_queryterm2scm (const QofQueryTerm *qt)
|
||||
{
|
||||
query_numeric_t pdata = (query_numeric_t) pd;
|
||||
|
||||
qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_long (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (gnc_query_numeric2scm (pdata->amount), qt_scm);
|
||||
|
||||
}
|
||||
@ -867,7 +867,7 @@ gnc_queryterm2scm (const QofQueryTerm *qt)
|
||||
{
|
||||
query_guid_t pdata = (query_guid_t) pd;
|
||||
|
||||
qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_long (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (gnc_guid_glist2scm (pdata->guids), qt_scm);
|
||||
|
||||
}
|
||||
@ -882,7 +882,7 @@ gnc_queryterm2scm (const QofQueryTerm *qt)
|
||||
{
|
||||
query_double_t pdata = (query_double_t) pd;
|
||||
|
||||
qt_scm = scm_cons (scm_make_real (pdata->val), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_double (pdata->val), qt_scm);
|
||||
|
||||
}
|
||||
else if (!g_strcmp0 (pd->type_name, QOF_TYPE_BOOLEAN))
|
||||
@ -896,7 +896,7 @@ gnc_queryterm2scm (const QofQueryTerm *qt)
|
||||
{
|
||||
query_char_t pdata = (query_char_t) pd;
|
||||
|
||||
qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (scm_from_long (pdata->options), qt_scm);
|
||||
qt_scm = scm_cons (scm_makfrom0str (pdata->char_list), qt_scm);
|
||||
|
||||
}
|
||||
@ -1074,7 +1074,7 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
|
||||
qt_scm = SCM_CDR (qt_scm);
|
||||
if (!scm_is_number (scm))
|
||||
break;
|
||||
val = scm_num2dbl (scm, G_STRFUNC);
|
||||
val = scm_to_double (scm);
|
||||
|
||||
pd = qof_query_double_predicate (compare_how, val);
|
||||
|
||||
@ -1288,7 +1288,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
|
||||
break;
|
||||
scm = SCM_CAR (query_term_scm);
|
||||
query_term_scm = SCM_CDR (query_term_scm);
|
||||
amount = scm_num2dbl (scm, G_STRFUNC);
|
||||
amount = scm_to_double (scm);
|
||||
|
||||
val = double_to_gnc_numeric (amount, GNC_DENOM_AUTO,
|
||||
GNC_HOW_DENOM_SIGFIGS(6) | GNC_HOW_RND_ROUND_HALF_UP);
|
||||
@ -1688,7 +1688,7 @@ gnc_query_sort2scm (const QofQuerySort *qs)
|
||||
return SCM_BOOL_F;
|
||||
|
||||
sort_scm = scm_cons (gnc_query_path2scm (path), sort_scm);
|
||||
sort_scm = scm_cons (scm_int2num (qof_query_sort_get_sort_options (qs)), sort_scm);
|
||||
sort_scm = scm_cons (scm_from_int (qof_query_sort_get_sort_options (qs)), sort_scm);
|
||||
sort_scm = scm_cons (SCM_BOOL (qof_query_sort_get_increasing (qs)), sort_scm);
|
||||
|
||||
return scm_reverse (sort_scm);
|
||||
@ -1728,7 +1728,7 @@ gnc_query_scm2sort (SCM sort_scm, GSList **path, gint *options, gboolean *inc)
|
||||
gnc_query_path_free (p);
|
||||
return FALSE;
|
||||
}
|
||||
o = scm_num2int (val, SCM_ARG1, G_STRFUNC);
|
||||
o = scm_to_int (val);
|
||||
|
||||
/* increasing */
|
||||
val = SCM_CAR (sort_scm);
|
||||
@ -1764,12 +1764,12 @@ gnc_query2scm (QofQuery *q)
|
||||
|
||||
/* terms */
|
||||
pair = scm_cons (gnc_query_terms2scm (qof_query_get_terms (q)), SCM_EOL);
|
||||
pair = scm_cons (scm_str2symbol ("terms"), pair);
|
||||
pair = scm_cons (scm_from_locale_symbol ("terms"), pair);
|
||||
query_scm = scm_cons (pair, query_scm);
|
||||
|
||||
/* search-for */
|
||||
pair = scm_cons (scm_str2symbol (qof_query_get_search_for (q)), SCM_EOL);
|
||||
pair = scm_cons (scm_str2symbol ("search-for"), pair);
|
||||
pair = scm_cons (scm_from_locale_symbol (qof_query_get_search_for (q)), SCM_EOL);
|
||||
pair = scm_cons (scm_from_locale_symbol ("search-for"), pair);
|
||||
query_scm = scm_cons (pair, query_scm);
|
||||
|
||||
/* sorts... */
|
||||
@ -1777,27 +1777,27 @@ gnc_query2scm (QofQuery *q)
|
||||
|
||||
/* primary-sort */
|
||||
pair = scm_cons (gnc_query_sort2scm (s1), SCM_EOL);
|
||||
pair = scm_cons (scm_str2symbol ("primary-sort"), pair);
|
||||
pair = scm_cons (scm_from_locale_symbol ("primary-sort"), pair);
|
||||
query_scm = scm_cons (pair, query_scm);
|
||||
|
||||
/* secondary-sort */
|
||||
pair = scm_cons (gnc_query_sort2scm (s2), SCM_EOL);
|
||||
pair = scm_cons (scm_str2symbol ("secondary-sort"), pair);
|
||||
pair = scm_cons (scm_from_locale_symbol ("secondary-sort"), pair);
|
||||
query_scm = scm_cons (pair, query_scm);
|
||||
|
||||
/* tertiary-sort */
|
||||
pair = scm_cons (gnc_query_sort2scm (s3), SCM_EOL);
|
||||
pair = scm_cons (scm_str2symbol ("tertiary-sort"), pair);
|
||||
pair = scm_cons (scm_from_locale_symbol ("tertiary-sort"), pair);
|
||||
query_scm = scm_cons (pair, query_scm);
|
||||
|
||||
/* max results */
|
||||
pair = scm_cons (scm_int2num (qof_query_get_max_results (q)), SCM_EOL);
|
||||
pair = scm_cons (scm_str2symbol ("max-results"), pair);
|
||||
pair = scm_cons (scm_from_int (qof_query_get_max_results (q)), SCM_EOL);
|
||||
pair = scm_cons (scm_from_locale_symbol ("max-results"), pair);
|
||||
query_scm = scm_cons (pair, query_scm);
|
||||
|
||||
/* Reverse this list; tag it as 'query-v2' */
|
||||
pair = scm_reverse (query_scm);
|
||||
return scm_cons (scm_str2symbol ("query-v2"), pair);
|
||||
return scm_cons (scm_from_locale_symbol ("query-v2"), pair);
|
||||
}
|
||||
|
||||
static GSList *
|
||||
@ -2015,7 +2015,7 @@ gnc_scm2query_v1 (SCM query_scm)
|
||||
break;
|
||||
}
|
||||
|
||||
max_splits = scm_num2int (value, SCM_ARG1, G_STRFUNC);
|
||||
max_splits = scm_to_int (value);
|
||||
|
||||
}
|
||||
else
|
||||
@ -2154,7 +2154,7 @@ gnc_scm2query_v2 (SCM query_scm)
|
||||
break;
|
||||
}
|
||||
|
||||
max_results = scm_num2int (value, SCM_ARG1, G_STRFUNC);
|
||||
max_results = scm_to_int (value);
|
||||
|
||||
}
|
||||
else
|
||||
@ -2228,7 +2228,7 @@ SCM
|
||||
gnc_gint64_to_scm(const gint64 x)
|
||||
{
|
||||
#if GUILE_LONG_LONG_OK
|
||||
return scm_long_long2num(x);
|
||||
return scm_from_long_long(x);
|
||||
#else
|
||||
const gchar negative_p = (x < 0);
|
||||
const guint64 magnitude = negative_p ? -x : x;
|
||||
@ -2236,8 +2236,8 @@ gnc_gint64_to_scm(const gint64 x)
|
||||
const guint32 upper_half = (guint32) (magnitude >> 32);
|
||||
SCM result;
|
||||
|
||||
result = scm_sum(scm_ash(scm_ulong2num(upper_half), SCM_MAKINUM(32)),
|
||||
scm_ulong2num(lower_half));
|
||||
result = scm_sum(scm_ash(scm_from_ulong(upper_half), scm_from_int(32)),
|
||||
scm_from_ulong(lower_half));
|
||||
|
||||
if (negative_p)
|
||||
{
|
||||
@ -2254,12 +2254,7 @@ gint64
|
||||
gnc_scm_to_gint64(SCM num)
|
||||
{
|
||||
#if GUILE_LONG_LONG_OK
|
||||
#ifdef SCM_MINOR_VERSION
|
||||
/* Guile 1.6 and later have the SCM_XXX_VERSION macro */
|
||||
return scm_num2long_long(num, SCM_ARG1, "gnc_scm_to_gint64");
|
||||
#else
|
||||
return scm_num2long_long(num, (char *) SCM_ARG1, "gnc_scm_to_gint64");
|
||||
#endif
|
||||
return scm_to_long_long(num);
|
||||
#else
|
||||
static SCM bits00to15_mask = SCM_BOOL_F;
|
||||
SCM magnitude = scm_abs(num);
|
||||
@ -2270,12 +2265,12 @@ gnc_scm_to_gint64(SCM num)
|
||||
|
||||
/* This doesn't work -- atm (bit-extract 4000 0 32) proves it */
|
||||
/*
|
||||
SCM lower = scm_bit_extract(magnitude, SCM_MAKINUM(0), SCM_MAKINUM(32));
|
||||
SCM lower = scm_bit_extract(magnitude, scm_from_int(0), scm_from_int(32));
|
||||
*/
|
||||
|
||||
if (bits00to15_mask == SCM_BOOL_F)
|
||||
{
|
||||
bits00to15_mask = scm_ulong2num(0xFFFF);
|
||||
bits00to15_mask = scm_from_ulong(0xFFFF);
|
||||
scm_gc_protect_object (bits00to15_mask);
|
||||
}
|
||||
|
||||
@ -2290,10 +2285,10 @@ gnc_scm_to_gint64(SCM num)
|
||||
*/
|
||||
for (i = 48; i >= 0; i -= 16)
|
||||
{
|
||||
bits = scm_ash(magnitude, SCM_MAKINUM(-i));
|
||||
c_bits = scm_num2ulong(scm_logand(bits, bits00to15_mask), SCM_ARG1, G_STRFUNC);
|
||||
bits = scm_ash(magnitude, scm_from_int(-i));
|
||||
c_bits = scm_to_ulong(scm_logand(bits, bits00to15_mask));
|
||||
c_result += ((long long)c_bits << i);
|
||||
magnitude = scm_difference(magnitude, scm_ash(bits, SCM_MAKINUM(i)));
|
||||
magnitude = scm_difference(magnitude, scm_ash(bits, scm_from_int(i)));
|
||||
}
|
||||
|
||||
if (scm_negative_p(num) != SCM_BOOL_F)
|
||||
|
@ -27,7 +27,7 @@ gnc_scm_to_kvp_value_ptr(SCM val)
|
||||
}
|
||||
else
|
||||
{
|
||||
return kvp_value_new_double(scm_num2dbl(val, G_STRFUNC));
|
||||
return kvp_value_new_double(scm_to_double(val));
|
||||
}
|
||||
}
|
||||
else if (gnc_numeric_p(val))
|
||||
@ -77,7 +77,7 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val)
|
||||
return gnc_gint64_to_scm(kvp_value_get_gint64(val));
|
||||
break;
|
||||
case KVP_TYPE_DOUBLE:
|
||||
return scm_make_real(kvp_value_get_double(val));
|
||||
return scm_from_double (kvp_value_get_double(val));
|
||||
break;
|
||||
case KVP_TYPE_NUMERIC:
|
||||
return gnc_numeric_to_scm(kvp_value_get_numeric(val));
|
||||
|
@ -2416,7 +2416,7 @@ gnc_option_set_ui_value_number_range (GNCOption *option, gboolean use_default,
|
||||
|
||||
if (scm_is_number(value))
|
||||
{
|
||||
d_value = scm_num2dbl(value, G_STRFUNC);
|
||||
d_value = scm_to_double(value);
|
||||
gtk_spin_button_set_value(spinner, d_value);
|
||||
return FALSE;
|
||||
}
|
||||
@ -2693,7 +2693,7 @@ gnc_option_get_ui_value_date (GNCOption *option, GtkWidget *widget)
|
||||
/* GtkComboBox per-item tooltip changes needed below */
|
||||
index = gnc_combott_get_active(GNC_COMBOTT(widget));
|
||||
|
||||
type = scm_str2symbol("relative");
|
||||
type = scm_from_locale_symbol ("relative");
|
||||
val = gnc_option_permissible_value(option, index);
|
||||
result = scm_cons(type, val);
|
||||
}
|
||||
@ -2704,7 +2704,7 @@ gnc_option_get_ui_value_date (GNCOption *option, GtkWidget *widget)
|
||||
ts.tv_sec = gnc_date_edit_get_date(GNC_DATE_EDIT(widget));
|
||||
ts.tv_nsec = 0;
|
||||
|
||||
result = scm_cons(scm_str2symbol("absolute"), gnc_timespec2timepair(ts));
|
||||
result = scm_cons(scm_from_locale_symbol ("absolute"), gnc_timespec2timepair(ts));
|
||||
}
|
||||
else if (g_strcmp0(subtype, "both") == 0)
|
||||
{
|
||||
@ -2725,7 +2725,7 @@ gnc_option_get_ui_value_date (GNCOption *option, GtkWidget *widget)
|
||||
{
|
||||
ts.tv_sec = gnc_date_edit_get_date(GNC_DATE_EDIT(ab_widget));
|
||||
ts.tv_nsec = 0;
|
||||
result = scm_cons(scm_str2symbol("absolute"), gnc_timespec2timepair(ts));
|
||||
result = scm_cons(scm_from_locale_symbol ("absolute"), gnc_timespec2timepair(ts));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2733,7 +2733,7 @@ gnc_option_get_ui_value_date (GNCOption *option, GtkWidget *widget)
|
||||
index = gnc_combott_get_active(GNC_COMBOTT(rel_widget));
|
||||
|
||||
val = gnc_option_permissible_value(option, index);
|
||||
result = scm_cons(scm_str2symbol("relative"), val);
|
||||
result = scm_cons(scm_from_locale_symbol ("relative"), val);
|
||||
}
|
||||
}
|
||||
g_free(subtype);
|
||||
@ -2826,7 +2826,7 @@ gnc_option_get_ui_value_number_range (GNCOption *option, GtkWidget *widget)
|
||||
|
||||
value = gtk_spin_button_get_value(spinner);
|
||||
|
||||
return (scm_make_real(value));
|
||||
return (scm_from_double (value));
|
||||
}
|
||||
|
||||
static SCM
|
||||
@ -2851,10 +2851,10 @@ gnc_option_get_ui_value_color (GNCOption *option, GtkWidget *widget)
|
||||
scale = gnc_option_color_range(option);
|
||||
|
||||
result = SCM_EOL;
|
||||
result = scm_cons(scm_make_real(alpha * scale), result);
|
||||
result = scm_cons(scm_make_real(blue * scale), result);
|
||||
result = scm_cons(scm_make_real(green * scale), result);
|
||||
result = scm_cons(scm_make_real(red * scale), result);
|
||||
result = scm_cons(scm_from_double (alpha * scale), result);
|
||||
result = scm_cons(scm_from_double (blue * scale), result);
|
||||
result = scm_cons(scm_from_double (green * scale), result);
|
||||
result = scm_cons(scm_from_double (red * scale), result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -2409,7 +2409,7 @@ report_helper (GNCLedgerDisplay *ledger, Split *split, Query *query)
|
||||
arg = scm_apply (func, args, SCM_EOL);
|
||||
g_return_val_if_fail (scm_is_exact (arg), -1);
|
||||
|
||||
return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int (arg);
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
|
@ -2471,7 +2471,7 @@ report_helper (GNCLedgerDisplay2 *ledger, Split *split, Query *query)
|
||||
arg = scm_apply (func, args, SCM_EOL);
|
||||
g_return_val_if_fail (scm_is_exact (arg), -1);
|
||||
|
||||
return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
|
||||
return scm_to_int (arg);
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************\
|
||||
* guile-mappings.h - Guile version compatability mappings *
|
||||
* guile-mappings.h - Guile version compatibility mappings *
|
||||
* Copyright (C) 2003, David Hampton *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
|
@ -490,7 +490,7 @@ gnc_ui_qif_import_select_loaded_file_cb(GtkTreeSelection *selection,
|
||||
{
|
||||
scm_gc_unprotect_object(wind->selected_file);
|
||||
wind->selected_file = scm_list_ref(wind->imported_files,
|
||||
scm_int2num(row));
|
||||
scm_from_int (row));
|
||||
scm_gc_protect_object(wind->selected_file);
|
||||
g_object_set(button, "sensitive", TRUE, (gchar*)NULL);
|
||||
}
|
||||
@ -618,7 +618,7 @@ rematch_line(QIFImportWindow *wind, GtkTreeSelection *selection,
|
||||
return;
|
||||
|
||||
/* Find the <qif-map-entry> corresponding to the selected row. */
|
||||
map_entry = scm_list_ref(display_info, scm_int2num(row));
|
||||
map_entry = scm_list_ref(display_info, scm_from_int (row));
|
||||
|
||||
/* Call the account picker to update it. */
|
||||
if (!qif_account_picker_dialog(wind, map_entry))
|
||||
@ -638,7 +638,7 @@ rematch_line(QIFImportWindow *wind, GtkTreeSelection *selection,
|
||||
gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
|
||||
|
||||
/* Update the <qif-map-entry> for the selected row. */
|
||||
map_entry = scm_list_ref(display_info, scm_int2num(row));
|
||||
map_entry = scm_list_ref(display_info, scm_from_int (row));
|
||||
scm_call_2(set_gnc_name, map_entry, gnc_name);
|
||||
|
||||
/* Update the mapping hash table. */
|
||||
@ -1117,9 +1117,9 @@ refresh_old_transactions(QIFImportWindow * wind, int selection)
|
||||
if (wind->match_transactions != SCM_BOOL_F)
|
||||
{
|
||||
possible_matches = SCM_CDR(scm_list_ref(wind->match_transactions,
|
||||
scm_int2num(wind->selected_transaction)));
|
||||
scm_from_int (wind->selected_transaction)));
|
||||
scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
|
||||
possible_matches, scm_int2num(selection));
|
||||
possible_matches, scm_from_int (selection));
|
||||
|
||||
while (!scm_is_null(possible_matches))
|
||||
{
|
||||
@ -1462,12 +1462,12 @@ initialize_scheme(QIFImportWindow *wind)
|
||||
* categories to GnuCash accounts. */
|
||||
load_map_prefs = scm_c_eval_string("qif-import:load-map-prefs");
|
||||
mapping_info = scm_call_0(load_map_prefs);
|
||||
wind->gnc_acct_info = scm_list_ref(mapping_info, scm_int2num(0));
|
||||
wind->acct_map_info = scm_list_ref(mapping_info, scm_int2num(1));
|
||||
wind->cat_map_info = scm_list_ref(mapping_info, scm_int2num(2));
|
||||
wind->memo_map_info = scm_list_ref(mapping_info, scm_int2num(3));
|
||||
wind->security_hash = scm_list_ref(mapping_info, scm_int2num(4));
|
||||
wind->security_prefs = scm_list_ref(mapping_info, scm_int2num(5));
|
||||
wind->gnc_acct_info = scm_list_ref(mapping_info, scm_from_int (0));
|
||||
wind->acct_map_info = scm_list_ref(mapping_info, scm_from_int (1));
|
||||
wind->cat_map_info = scm_list_ref(mapping_info, scm_from_int (2));
|
||||
wind->memo_map_info = scm_list_ref(mapping_info, scm_from_int (3));
|
||||
wind->security_hash = scm_list_ref(mapping_info, scm_from_int (4));
|
||||
wind->security_prefs = scm_list_ref(mapping_info, scm_from_int (5));
|
||||
|
||||
/* Get the initial ticker map. */
|
||||
create_ticker_map = scm_c_eval_string("make-ticker-map");
|
||||
@ -1891,7 +1891,7 @@ gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
|
||||
* it's found, set up the format selector page. */
|
||||
if ((date_formats = scm_call_2(parse_results,
|
||||
SCM_CDR(parse_return),
|
||||
scm_str2symbol("date"))) != SCM_BOOL_F)
|
||||
scm_from_locale_symbol ("date"))) != SCM_BOOL_F)
|
||||
{
|
||||
GtkComboBox *combo_box;
|
||||
GtkTreeModel *model;
|
||||
@ -2047,7 +2047,7 @@ gnc_ui_qif_import_date_valid_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
g_critical("QIF import: BUG DETECTED in gnc_ui_qif_import_date_valid_cb. Format is NULL.");
|
||||
}
|
||||
format_sym = scm_str2symbol(text);
|
||||
format_sym = scm_from_locale_symbol (text);
|
||||
g_free(text);
|
||||
|
||||
/* Reparse the dates using the selected format. */
|
||||
|
@ -183,7 +183,7 @@ custom_report_run_report(SCM guid,
|
||||
if (!scm_is_null(guid))
|
||||
{
|
||||
/* this runs the report */
|
||||
report_id = SCM_INUM(scm_call_1(make_report, guid));
|
||||
report_id = scm_to_int (scm_call_1(make_report, guid));
|
||||
|
||||
/* do this *before* the report because sometimes the report
|
||||
takes a while... */
|
||||
@ -219,9 +219,8 @@ get_custom_report_selection(CustomReportDialog *crd,
|
||||
if (gtk_tree_selection_get_selected(sel, &model, &iter))
|
||||
{
|
||||
int num;
|
||||
|
||||
gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
|
||||
guid = scm_list_ref(crd->reportlist, scm_int2num(num));
|
||||
guid = scm_list_ref(crd->reportlist, scm_from_int (num));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -258,7 +257,7 @@ custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
|
||||
|
||||
gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
|
||||
|
||||
guid = scm_list_ref(crd->reportlist, scm_int2num(num));
|
||||
guid = scm_list_ref(crd->reportlist, scm_from_int (num));
|
||||
|
||||
custom_report_run_report(guid, crd);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ update_display_lists(gnc_column_view_edit * view)
|
||||
if (scm_is_list(view->available_list) && !scm_is_null (view->available_list))
|
||||
{
|
||||
row = MIN (row, scm_ilength (view->available_list) - 1);
|
||||
selection = scm_list_ref (view->available_list, scm_int2num (row));
|
||||
selection = scm_list_ref (view->available_list, scm_from_int (row));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -176,7 +176,7 @@ update_display_lists(gnc_column_view_edit * view)
|
||||
if (scm_is_list(view->contents_list) && !scm_is_null (view->contents_list))
|
||||
{
|
||||
row = MIN (row, scm_ilength (view->contents_list) - 1);
|
||||
selection = scm_list_ref (view->contents_list, scm_int2num (row));
|
||||
selection = scm_list_ref (view->contents_list, scm_from_int (row));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -198,7 +198,7 @@ update_display_lists(gnc_column_view_edit * view)
|
||||
if (scm_is_equal (SCM_CAR(contents), selection))
|
||||
row = i;
|
||||
|
||||
id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
|
||||
id = scm_to_int(SCM_CAAR(contents));
|
||||
this_report = gnc_report_find(id);
|
||||
scm_dynwind_begin (0);
|
||||
str = scm_to_locale_string (scm_call_1(report_menu_name, this_report));
|
||||
@ -211,10 +211,8 @@ update_display_lists(gnc_column_view_edit * view)
|
||||
(store, &iter,
|
||||
CONTENTS_COL_NAME, name,
|
||||
CONTENTS_COL_ROW, i,
|
||||
CONTENTS_COL_REPORT_COLS, scm_num2int(SCM_CADR(SCM_CAR(contents)),
|
||||
SCM_ARG1, G_STRFUNC),
|
||||
CONTENTS_COL_REPORT_ROWS, scm_num2int(SCM_CADDR(SCM_CAR(contents)),
|
||||
SCM_ARG1, G_STRFUNC),
|
||||
CONTENTS_COL_REPORT_COLS, scm_to_int(SCM_CADR(SCM_CAR(contents))),
|
||||
CONTENTS_COL_REPORT_ROWS, scm_to_int(SCM_CADDR(SCM_CAR(contents))),
|
||||
-1);
|
||||
}
|
||||
}
|
||||
@ -413,9 +411,9 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
|
||||
(scm_ilength(r->available_list) > r->available_selected))
|
||||
{
|
||||
template_name = scm_list_ref(r->available_list,
|
||||
scm_int2num(r->available_selected));
|
||||
scm_from_int (r->available_selected));
|
||||
new_report = scm_call_1(make_report, template_name);
|
||||
id = scm_num2int(new_report, SCM_ARG1, G_STRFUNC);
|
||||
id = scm_to_int(new_report);
|
||||
scm_call_2(mark_report, gnc_report_find(id), SCM_BOOL_T);
|
||||
oldlength = scm_ilength(r->contents_list);
|
||||
|
||||
@ -428,8 +426,8 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
|
||||
}
|
||||
newlist = scm_append
|
||||
(scm_listify(scm_reverse(scm_cons(SCM_LIST4(new_report,
|
||||
scm_int2num(1),
|
||||
scm_int2num(1),
|
||||
scm_from_int (1),
|
||||
scm_from_int (1),
|
||||
SCM_BOOL_F),
|
||||
newlist)),
|
||||
oldlist,
|
||||
@ -440,8 +438,8 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
|
||||
newlist = scm_append
|
||||
(scm_listify(oldlist,
|
||||
SCM_LIST1(SCM_LIST4(new_report,
|
||||
scm_int2num(1),
|
||||
scm_int2num(1),
|
||||
scm_from_int (1),
|
||||
scm_from_int (1),
|
||||
SCM_BOOL_F)),
|
||||
SCM_UNDEFINED));
|
||||
r->contents_selected = oldlength;
|
||||
@ -604,13 +602,11 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
|
||||
if (length > r->contents_selected)
|
||||
{
|
||||
current = scm_list_ref(r->contents_list,
|
||||
scm_int2num(r->contents_selected));
|
||||
scm_from_int (r->contents_selected));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(colspin),
|
||||
(float)scm_num2int(SCM_CADR(current),
|
||||
SCM_ARG1, G_STRFUNC));
|
||||
(float)scm_to_int(SCM_CADR(current)));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(rowspin),
|
||||
(float)scm_num2int(SCM_CADDR(current),
|
||||
SCM_ARG1, G_STRFUNC));
|
||||
(float)scm_to_int(SCM_CADDR(current)));
|
||||
|
||||
dlg_ret = gtk_dialog_run(GTK_DIALOG(dlg));
|
||||
gtk_widget_hide(dlg);
|
||||
@ -618,14 +614,14 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
|
||||
if (dlg_ret == GTK_RESPONSE_OK)
|
||||
{
|
||||
current = SCM_LIST4(SCM_CAR(current),
|
||||
scm_int2num(gtk_spin_button_get_value_as_int
|
||||
scm_from_int (gtk_spin_button_get_value_as_int
|
||||
(GTK_SPIN_BUTTON(colspin))),
|
||||
scm_int2num(gtk_spin_button_get_value_as_int
|
||||
scm_from_int (gtk_spin_button_get_value_as_int
|
||||
(GTK_SPIN_BUTTON(rowspin))),
|
||||
SCM_BOOL_F);
|
||||
scm_gc_unprotect_object(r->contents_list);
|
||||
r->contents_list = scm_list_set_x(r->contents_list,
|
||||
scm_int2num(r->contents_selected),
|
||||
scm_from_int (r->contents_selected),
|
||||
current);
|
||||
scm_gc_protect_object(r->contents_list);
|
||||
gnc_options_dialog_changed (r->optwin);
|
||||
|
@ -641,7 +641,7 @@ gnc_plugin_page_report_history_destroy_cb(gnc_html_history_node * node,
|
||||
{
|
||||
sscanf(node->location + 3, "%d", &report_id);
|
||||
/* printf("unreffing report %d and children\n", report_id);
|
||||
scm_call_1(remover, scm_int2num(report_id)); */
|
||||
scm_call_1(remover, scm_from_int (report_id)); */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -760,7 +760,7 @@ gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
|
||||
embedded = SCM_CDR(embedded);
|
||||
if (!scm_is_number(item))
|
||||
continue;
|
||||
id = SCM_INUM(item);
|
||||
id = scm_to_int (item);
|
||||
tmp_report = gnc_report_find(id);
|
||||
scm_text = scm_call_1(gen_save_text, tmp_report);
|
||||
if (!scm_is_string (scm_text))
|
||||
@ -874,7 +874,7 @@ gnc_plugin_page_report_recreate_page (GtkWidget *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
report_id = scm_num2int(final_id, SCM_ARG1, G_STRFUNC);
|
||||
report_id = scm_to_int(final_id);
|
||||
report = gnc_report_find(report_id);
|
||||
if (!report)
|
||||
{
|
||||
@ -1406,7 +1406,7 @@ gnc_get_export_type_choice (SCM export_types)
|
||||
if (choice >= scm_ilength (export_types))
|
||||
return SCM_BOOL_F;
|
||||
|
||||
return scm_list_ref (export_types, scm_int2num (choice));
|
||||
return scm_list_ref (export_types, scm_from_int (choice));
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -81,7 +81,7 @@ gint gnc_report_add(SCM report)
|
||||
value = scm_call_1(get_id, report);
|
||||
if (scm_is_number(value))
|
||||
{
|
||||
id = scm_num2int(value, SCM_ARG1, G_STRFUNC);
|
||||
id = scm_to_int(value);
|
||||
if (!g_hash_table_lookup(reports, &id))
|
||||
{
|
||||
key = g_new(gint, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user