Commit 13d0e122 authored by Morten Welinder's avatar Morten Welinder

Compilation: don't use printf in C code.

Use g_printerr.
parent c499ce3c
2012-12-28 Morten Welinder <terra@gnome.org>
* src/*.c: Eliminate use of printf.
* src/sheet-style.c (sheet_style_range_foreach): Move handling of
range offset here. This may need to move further.
* src/ssdiff.c (cb_diff_sheets_styles_2): From here.
......
......@@ -1937,7 +1937,7 @@ opt_binomial(GnmFuncEvalInfo *ei, GnmValue const * const *argv)
for (j = n - 1; j > -1; --j) {
for (i = 0; i <= j; ++i) {
/*if (0==i)printf("secondloop %d\n",j);*/
/*if (0==i)g_printerr("secondloop %d\n",j);*/
if (OT_Euro == amer_euro_flag)
value_array[i] = (p * value_array[i + 1] + (1.0 - p) * value_array[i]) * Df;
else if (OT_Amer == amer_euro_flag) {
......
......@@ -1262,7 +1262,7 @@ gnumeric_rate (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
return value_new_error_VALUE (ei->pos);
#if 0
printf ("Guess = %.15g\n", rate0);
g_printerr ("Guess = %.15g\n", rate0);
#endif
goal_seek_initialize (&data);
......@@ -1292,7 +1292,7 @@ gnumeric_rate (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (status == GOAL_SEEK_OK) {
#if 0
printf ("Root = %.15g\n\n", data.root);
g_printerr ("Root = %.15g\n\n", data.root);
#endif
return value_new_float (data.root);
} else
......
......@@ -971,7 +971,7 @@ colrow_visibility (Sheet const *sheet, ColRowVisiblity * const dat,
res->first = (j >= first) ? j+1 : first;
res->last = i;
#if 0
printf ("%d %d\n", res->index, res->count);
g_printerr ("%d %d\n", res->index, res->count);
#endif
dat->elements = g_slist_insert_sorted (dat->elements, res,
(GCompareFunc)colrow_index_cmp);
......
......@@ -237,7 +237,7 @@ function_dump_defs (char const *filename, int dump_type)
g_return_if_fail (filename != NULL);
if ((output_file = g_fopen (filename, "w")) == NULL){
printf (_("Cannot create file %s\n"), filename);
g_printerr (_("Cannot create file %s\n"), filename);
exit (1);
}
......
......@@ -219,15 +219,15 @@ int main(void)
int i;
unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4;
init_by_array(init, length);
printf("1000 outputs of genrand_int32()\n");
g_printerr("1000 outputs of genrand_int32()\n");
for (i=0; i<1000; i++) {
printf("%10lu ", genrand_int32());
if (i%5==4) printf("\n");
g_printerr("%10lu ", genrand_int32());
if (i%5==4) g_printerr("\n");
}
printf("\n1000 outputs of genrand_real2()\n");
g_printerr("\n1000 outputs of genrand_real2()\n");
for (i=0; i<1000; i++) {
printf("%10.8f ", genrand_real2());
if (i%5==4) printf("\n");
g_printerr("%10.8f ", genrand_real2());
if (i%5==4) g_printerr("\n");
}
return 0;
}
......
......@@ -131,7 +131,7 @@ gnm_style_element_name[MSTYLE_ELEMENT_MAX] = {
/* Some ref/link count debugging */
#if 0
#define d(arg) printf arg
#define d(arg) g_printerr arg
#else
#define d(arg) do { } while (0)
#endif
......
#include <gnumeric-config.h>
#include "gnumeric.h"
#include "number-match.h"
#include <stdio.h>
int
main ()
{
char buffer [100], *format;
double v;
char *s;
/* format_match_init (); */
/* To test the formats of the type "0.0 pesos" */
format_match_define ("0.0 \"pesos\"");
printf ("Enter a string that you want to match against the\n"
"Gnumeric formats\n");
while (1){
printf ("> ");
fflush (stdout);
s = gets (buffer);
if (!s)
break;
if (s [strlen (s)-1] == '\n')
s [strlen (s)-1] = 0;
if (format_match (s, NULL, &format))
printf ("Format matched: %s\n", format);
else
printf ("No match found\n");
}
return 0;
}
......@@ -1496,7 +1496,7 @@ int
yyerror (char const *s)
{
#if 0
printf ("Error: %s\n", s);
g_printerr ("Error: %s\n", s);
#endif
return 0;
}
......
......@@ -2582,7 +2582,7 @@ cb_wbcg_drag_data_received (GtkWidget *widget, GdkDragContext *context,
} else {
GtkWidget *source_widget = gtk_drag_get_source_widget (context);
if (wbcg_is_local_drag (wbcg, source_widget))
printf ("autoscroll complete - stop it\n");
g_printerr ("autoscroll complete - stop it\n");
else
scg_drag_data_received (wbcg_cur_scg (wbcg),
source_widget, 0, 0, selection_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment