On all gimp-core fopen()s changed "[rw]"->"[rw]b" to appease OS/2 folk.

* app/[lots of files].c: On all gimp-core fopen()s
        changed "[rw]"->"[rw]b" to appease OS/2 folk.
This commit is contained in:
Adam D. Moss 1998-07-31 18:34:05 +00:00
parent 9e4d86333a
commit 5b6e6cd6f0
61 changed files with 92 additions and 87 deletions

View File

@ -1,3 +1,8 @@
Fri Jul 31 19:17:15 BST 1998 Adam D. Moss <adam@gimp.org>
* app/[lots of files].c: On all gimp-core fopen()s
changed "[rw]"->"[rw]b" to appease OS/2 folk.
Fri Jul 31 18:29:44 BST 1998 Adam D. Moss <adam@gimp.org>
* app/layers_dialog.c: Removed an ancient kludge that was

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -158,7 +158,7 @@ splash_logo_load_size (GtkWidget *window)
sprintf (buf, "%s/gimp1_1_splash.ppm", DATADIR);
fp = fopen (buf, "r");
fp = fopen (buf, "rb");
if (!fp)
return 0;
@ -193,7 +193,7 @@ splash_logo_load (GtkWidget *window)
sprintf (buf, "%s/gimp1_1_splash.ppm", DATADIR);
fp = fopen (buf, "r");
fp = fopen (buf, "rb");
if (!fp)
return 0;

View File

@ -472,7 +472,7 @@ temp_buf_swap (buf)
}
/* Open file for overwrite */
if ((fp = fopen (filename, "w")))
if ((fp = fopen (filename, "wb")))
{
fwrite (swap->data, swap->width * swap->height * swap->bytes, 1, fp);
fclose (fp);
@ -520,7 +520,7 @@ temp_buf_unswap (buf)
/* (buf->filname HAS to be != 0 */
if (!stat (buf->filename, &stat_buf))
{
if ((fp = fopen (buf->filename, "r")))
if ((fp = fopen (buf->filename, "rb")))
{
size_t blocksRead;
blocksRead = fread (buf->data, buf->width * buf->height * buf->bytes, 1, fp);

View File

@ -46,7 +46,7 @@ batch_init ()
}
else
{
fp = fopen (batch_cmds[i], "r");
fp = fopen (batch_cmds[i], "rb");
if (!fp)
g_print ("unable to open batch file: \"%s\"\n", batch_cmds[i]);

View File

@ -1841,7 +1841,7 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
pn_dlg = (PasteNamedDlg *) client_data;
f = fopen(filename, "r");
f = fopen(filename, "rb");
printf("reading %s\n", filename);
while(!feof(f))
@ -1917,7 +1917,7 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
else
{
PasteNamedDlg *pn_dlg;
f = fopen(filename, "w");
f = fopen(filename, "wb");
if (NULL == f)
{
perror(filename);

View File

@ -148,7 +148,7 @@ gimp_brush_load(GimpBrush *brush, char *filename)
brush->filename = g_strdup (filename);
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
if (! (fp = fopen (filename, "rb")))
{
gimp_object_destroy (brush);
return;

View File

@ -148,7 +148,7 @@ gimp_brush_load(GimpBrush *brush, char *filename)
brush->filename = g_strdup (filename);
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
if (! (fp = fopen (filename, "rb")))
{
gimp_object_destroy (brush);
return;

View File

@ -108,7 +108,7 @@ gimp_brush_generated_load (char *file_name)
char string[256];
float fl;
float version;
if ((fp = fopen(file_name, "r")) == NULL)
if ((fp = fopen(file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
@ -158,7 +158,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
{
/* WARNING: untested function */
FILE *fp;
if ((fp = fopen(file_name, "w")) == NULL)
if ((fp = fopen(file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
return;

View File

@ -108,7 +108,7 @@ gimp_brush_generated_load (char *file_name)
char string[256];
float fl;
float version;
if ((fp = fopen(file_name, "r")) == NULL)
if ((fp = fopen(file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
@ -158,7 +158,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
{
/* WARNING: untested function */
FILE *fp;
if ((fp = fopen(file_name, "w")) == NULL)
if ((fp = fopen(file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
return;

View File

@ -108,7 +108,7 @@ gimp_brush_generated_load (char *file_name)
char string[256];
float fl;
float version;
if ((fp = fopen(file_name, "r")) == NULL)
if ((fp = fopen(file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
@ -158,7 +158,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
{
/* WARNING: untested function */
FILE *fp;
if ((fp = fopen(file_name, "w")) == NULL)
if ((fp = fopen(file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
return;

View File

@ -554,7 +554,7 @@ devices_write_rc (void)
{
sprintf (filename, "%s/devicerc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -213,7 +213,7 @@ read_tips_file (char *filename)
char *tip = NULL;
char *str = NULL;
fp = fopen (filename, "rt");
fp = fopen (filename, "rb");
if (!fp)
{
store_tip ("Your GIMP tips file appears to be missing!\n"

View File

@ -165,10 +165,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
break;
case GDK_LEAVE_NOTIFY:
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
update_cursor = 0;
break;

View File

@ -165,10 +165,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
break;
case GDK_LEAVE_NOTIFY:
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
update_cursor = 0;
break;

View File

@ -165,10 +165,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
break;
case GDK_LEAVE_NOTIFY:
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
gtk_label_set(GTK_LABEL (gdisp->cursor_label), "");
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
update_cursor = 0;
break;

View File

@ -215,7 +215,7 @@ load_idea_manager( idea_manager *ideas )
/* open persistant desktop file. */
desktopfile = append2( home_dir, FALSE, IDEAPATH, FALSE );
fp = fopen( desktopfile, "r" );
fp = fopen( desktopfile, "rb" );
g_free( desktopfile );
/* Read in persistant desktop information. */
@ -290,7 +290,7 @@ save_idea_manager( idea_manager *ideas )
/* open persistant desktop file. */
desktopfile = append2( home_dir, FALSE, IDEAPATH, FALSE );
fp = fopen( desktopfile, "w" );
fp = fopen( desktopfile, "wb" );
g_free( desktopfile );
if ( fp )
@ -439,7 +439,7 @@ static void idea_add_in_position_with_select( gchar *title, gint position, gbool
/* open persistant desktop file. */
desktopfile = append2( home_dir, FALSE, IDEAPATH, FALSE );
fp = fopen( desktopfile, "r" );
fp = fopen( desktopfile, "rb" );
g_free( desktopfile );
/* Read in persistant desktop information. */

View File

@ -148,7 +148,7 @@ gimp_brush_load(GimpBrush *brush, char *filename)
brush->filename = g_strdup (filename);
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
if (! (fp = fopen (filename, "rb")))
{
gimp_object_destroy (brush);
return;

View File

@ -108,7 +108,7 @@ gimp_brush_generated_load (char *file_name)
char string[256];
float fl;
float version;
if ((fp = fopen(file_name, "r")) == NULL)
if ((fp = fopen(file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
@ -158,7 +158,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
{
/* WARNING: untested function */
FILE *fp;
if ((fp = fopen(file_name, "w")) == NULL)
if ((fp = fopen(file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
return;

View File

@ -363,7 +363,7 @@ parse_gimprc_file (char *filename)
filename = rfilename;
}
parse_info.fp = fopen (filename, "rt");
parse_info.fp = fopen (filename, "rb");
if (!parse_info.fp)
return;
@ -2121,7 +2121,7 @@ open_backup_file (char *filename,
/*
Rename the file to *.old, open it for reading and create the new file.
*/
if ((*fp_old = fopen (filename, "rt")) == NULL)
if ((*fp_old = fopen (filename, "rb")) == NULL)
{
if (errno == EACCES)
return "Can't open gimprc; permission problems";
@ -2142,7 +2142,7 @@ open_backup_file (char *filename,
return "Can't rename gimprc to gimprc.old, reason unknown";
}
if ((*fp_new = fopen (filename, "wt")) == NULL)
if ((*fp_new = fopen (filename, "wb")) == NULL)
{
(void) rename (oldfilename, filename);
g_free (oldfilename);

View File

@ -1623,7 +1623,7 @@ ed_do_save_pov_callback(GtkWidget *widget, gpointer client_data)
filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(client_data));
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file)
g_message ("ed_do_save_pov_callback(): oops, could not open \"%s\"", filename);
@ -5330,7 +5330,7 @@ grad_load_gradient(char *filename)
g_assert(filename != NULL);
file = fopen(filename, "r");
file = fopen(filename, "rb");
if (!file)
return;
@ -5408,7 +5408,7 @@ grad_save_gradient(gradient_t *grad, char *filename)
return;
} /* if */
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file) {
g_message ("grad_save_gradient(): can't open \"%s\"", filename);
return;

View File

@ -1623,7 +1623,7 @@ ed_do_save_pov_callback(GtkWidget *widget, gpointer client_data)
filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(client_data));
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file)
g_message ("ed_do_save_pov_callback(): oops, could not open \"%s\"", filename);
@ -5330,7 +5330,7 @@ grad_load_gradient(char *filename)
g_assert(filename != NULL);
file = fopen(filename, "r");
file = fopen(filename, "rb");
if (!file)
return;
@ -5408,7 +5408,7 @@ grad_save_gradient(gradient_t *grad, char *filename)
return;
} /* if */
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file) {
g_message ("grad_save_gradient(): can't open \"%s\"", filename);
return;

View File

@ -554,7 +554,7 @@ devices_write_rc (void)
{
sprintf (filename, "%s/devicerc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1623,7 +1623,7 @@ ed_do_save_pov_callback(GtkWidget *widget, gpointer client_data)
filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(client_data));
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file)
g_message ("ed_do_save_pov_callback(): oops, could not open \"%s\"", filename);
@ -5330,7 +5330,7 @@ grad_load_gradient(char *filename)
g_assert(filename != NULL);
file = fopen(filename, "r");
file = fopen(filename, "rb");
if (!file)
return;
@ -5408,7 +5408,7 @@ grad_save_gradient(gradient_t *grad, char *filename)
return;
} /* if */
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file) {
g_message ("grad_save_gradient(): can't open \"%s\"", filename);
return;

View File

@ -554,7 +554,7 @@ devices_write_rc (void)
{
sprintf (filename, "%s/devicerc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -533,7 +533,7 @@ palette_entries_load (char *filename)
/* Open the requested file */
if (!(fp = fopen (filename, "r")))
if (!(fp = fopen (filename, "rb")))
{
palette_entries_free (entries);
return;
@ -612,7 +612,7 @@ palette_entries_save (PaletteEntriesP palette,
return;
/* Open the requested file */
if (! (fp = fopen (filename, "w")))
if (! (fp = fopen (filename, "wb")))
{
g_message ("can't save palette \"%s\"\n", filename);
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -135,7 +135,7 @@ save_sessionrc (void)
{
sprintf (filename, "%s/sessionrc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -213,7 +213,7 @@ read_tips_file (char *filename)
char *tip = NULL;
char *str = NULL;
fp = fopen (filename, "rt");
fp = fopen (filename, "rb");
if (!fp)
{
store_tip ("Your GIMP tips file appears to be missing!\n"

View File

@ -2120,7 +2120,7 @@ construct_edge_map (Tool *tool,
/* dump the edge buffer for debugging*/
dump=fopen("dump", "w");
dump=fopen("dump", "wb");
fprintf(dump, "P5\n%d %d\n255\n", edge_buf->width, edge_buf->height);
fwrite(edge_buf->data, edge_buf->width * edge_buf->height, sizeof (guchar), dump);
fclose (dump);

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -533,7 +533,7 @@ palette_entries_load (char *filename)
/* Open the requested file */
if (!(fp = fopen (filename, "r")))
if (!(fp = fopen (filename, "rb")))
{
palette_entries_free (entries);
return;
@ -612,7 +612,7 @@ palette_entries_save (PaletteEntriesP palette,
return;
/* Open the requested file */
if (! (fp = fopen (filename, "w")))
if (! (fp = fopen (filename, "wb")))
{
g_message ("can't save palette \"%s\"\n", filename);
return;

View File

@ -167,7 +167,7 @@ load_pattern (char *filename)
pattern->mask = NULL;
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
if (! (fp = fopen (filename, "rb")))
{
free_pattern (pattern);
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1924,7 +1924,7 @@ plug_in_write_rc (char *filename)
GSList *tmp, *tmp2;
int i;
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -844,7 +844,7 @@ procedural_db_dump (Argument *args)
if (filename)
{
if (! (procedural_db_out = fopen (filename, "w")))
if (! (procedural_db_out = fopen (filename, "wb")))
success = FALSE;
}
else

View File

@ -135,7 +135,7 @@ save_sessionrc (void)
{
sprintf (filename, "%s/sessionrc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -472,7 +472,7 @@ temp_buf_swap (buf)
}
/* Open file for overwrite */
if ((fp = fopen (filename, "w")))
if ((fp = fopen (filename, "wb")))
{
fwrite (swap->data, swap->width * swap->height * swap->bytes, 1, fp);
fclose (fp);
@ -520,7 +520,7 @@ temp_buf_unswap (buf)
/* (buf->filname HAS to be != 0 */
if (!stat (buf->filename, &stat_buf))
{
if ((fp = fopen (buf->filename, "r")))
if ((fp = fopen (buf->filename, "rb")))
{
size_t blocksRead;
blocksRead = fread (buf->data, buf->width * buf->height * buf->bytes, 1, fp);

View File

@ -213,7 +213,7 @@ read_tips_file (char *filename)
char *tip = NULL;
char *str = NULL;
fp = fopen (filename, "rt");
fp = fopen (filename, "rb");
if (!fp)
{
store_tip ("Your GIMP tips file appears to be missing!\n"

View File

@ -1841,7 +1841,7 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
pn_dlg = (PasteNamedDlg *) client_data;
f = fopen(filename, "r");
f = fopen(filename, "rb");
printf("reading %s\n", filename);
while(!feof(f))
@ -1917,7 +1917,7 @@ static void file_ok_callback(GtkWidget * widget, gpointer client_data)
else
{
PasteNamedDlg *pn_dlg;
f = fopen(filename, "w");
f = fopen(filename, "wb");
if (NULL == f)
{
perror(filename);

View File

@ -2120,7 +2120,7 @@ construct_edge_map (Tool *tool,
/* dump the edge buffer for debugging*/
dump=fopen("dump", "w");
dump=fopen("dump", "wb");
fprintf(dump, "P5\n%d %d\n255\n", edge_buf->width, edge_buf->height);
fwrite(edge_buf->data, edge_buf->width * edge_buf->height, sizeof (guchar), dump);
fclose (dump);

View File

@ -2120,7 +2120,7 @@ construct_edge_map (Tool *tool,
/* dump the edge buffer for debugging*/
dump=fopen("dump", "w");
dump=fopen("dump", "wb");
fprintf(dump, "P5\n%d %d\n255\n", edge_buf->width, edge_buf->height);
fwrite(edge_buf->data, edge_buf->width * edge_buf->height, sizeof (guchar), dump);
fclose (dump);

View File

@ -554,7 +554,7 @@ devices_write_rc (void)
{
sprintf (filename, "%s/devicerc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -554,7 +554,7 @@ devices_write_rc (void)
{
sprintf (filename, "%s/devicerc", gimp_dir);
fp = fopen (filename, "w");
fp = fopen (filename, "wb");
if (!fp)
return;

View File

@ -1623,7 +1623,7 @@ ed_do_save_pov_callback(GtkWidget *widget, gpointer client_data)
filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(client_data));
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file)
g_message ("ed_do_save_pov_callback(): oops, could not open \"%s\"", filename);
@ -5330,7 +5330,7 @@ grad_load_gradient(char *filename)
g_assert(filename != NULL);
file = fopen(filename, "r");
file = fopen(filename, "rb");
if (!file)
return;
@ -5408,7 +5408,7 @@ grad_save_gradient(gradient_t *grad, char *filename)
return;
} /* if */
file = fopen(filename, "w");
file = fopen(filename, "wb");
if (!file) {
g_message ("grad_save_gradient(): can't open \"%s\"", filename);
return;

View File

@ -533,7 +533,7 @@ palette_entries_load (char *filename)
/* Open the requested file */
if (!(fp = fopen (filename, "r")))
if (!(fp = fopen (filename, "rb")))
{
palette_entries_free (entries);
return;
@ -612,7 +612,7 @@ palette_entries_save (PaletteEntriesP palette,
return;
/* Open the requested file */
if (! (fp = fopen (filename, "w")))
if (! (fp = fopen (filename, "wb")))
{
g_message ("can't save palette \"%s\"\n", filename);
return;