summaryrefslogtreecommitdiffstats
path: root/libgfortran/io
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/fbuf.c6
-rw-r--r--libgfortran/io/format.c11
-rw-r--r--libgfortran/io/list_read.c14
-rw-r--r--libgfortran/io/lock.c14
-rw-r--r--libgfortran/io/open.c11
-rw-r--r--libgfortran/io/unit.c13
-rw-r--r--libgfortran/io/unix.c14
-rw-r--r--libgfortran/io/write.c8
-rw-r--r--libgfortran/io/write_float.def4
9 files changed, 50 insertions, 45 deletions
diff --git a/libgfortran/io/fbuf.c b/libgfortran/io/fbuf.c
index d79cf15c473..82b3f6ba6c6 100644
--- a/libgfortran/io/fbuf.c
+++ b/libgfortran/io/fbuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Janne Blomqvist
This file is part of the GNU Fortran runtime library (libgfortran).
@@ -52,8 +52,8 @@ fbuf_destroy (gfc_unit * u)
if (u->fbuf == NULL)
return;
if (u->fbuf->buf)
- free_mem (u->fbuf->buf);
- free_mem (u->fbuf);
+ free (u->fbuf->buf);
+ free (u->fbuf);
u->fbuf = NULL;
}
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index c7188a8a0d6..5771777a121 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -3,7 +3,7 @@
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
+#include <stdlib.h>
#define FARRAY_SIZE 64
@@ -90,7 +91,7 @@ free_format_hash_table (gfc_unit *u)
if (u->format_hash_table[i].hashed_fmt != NULL)
{
free_format_data (u->format_hash_table[i].hashed_fmt);
- free_mem (u->format_hash_table[i].key);
+ free (u->format_hash_table[i].key);
}
u->format_hash_table[i].key = NULL;
u->format_hash_table[i].key_len = 0;
@@ -171,7 +172,7 @@ save_parsed_format (st_parameter_dt *dtp)
u->format_hash_table[hash].hashed_fmt = NULL;
if (u->format_hash_table[hash].key != NULL)
- free_mem (u->format_hash_table[hash].key);
+ free (u->format_hash_table[hash].key);
u->format_hash_table[hash].key = get_mem (dtp->format_len);
memcpy (u->format_hash_table[hash].key, dtp->format, dtp->format_len);
@@ -282,10 +283,10 @@ free_format_data (format_data *fmt)
for (fa = fmt->array.next; fa; fa = fa_next)
{
fa_next = fa->next;
- free_mem (fa);
+ free (fa);
}
- free_mem (fmt);
+ free (fmt);
fmt = NULL;
}
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b645d57a71f..2f0f931ab5a 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -4,7 +4,7 @@
Namelist input contributed by Paul Thomas
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -110,7 +110,7 @@ free_saved (st_parameter_dt *dtp)
if (dtp->u.p.saved_string == NULL)
return;
- free_mem (dtp->u.p.saved_string);
+ free (dtp->u.p.saved_string);
dtp->u.p.saved_string = NULL;
dtp->u.p.saved_used = 0;
@@ -128,7 +128,7 @@ free_line (st_parameter_dt *dtp)
if (dtp->u.p.line_buffer == NULL)
return;
- free_mem (dtp->u.p.line_buffer);
+ free (dtp->u.p.line_buffer);
dtp->u.p.line_buffer = NULL;
}
@@ -2175,7 +2175,7 @@ nml_touch_nodes (namelist_info * nl)
else
break;
}
- free_mem (ext_name);
+ free (ext_name);
return;
}
@@ -2440,18 +2440,18 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
pprev_nl, nml_err_msg, nml_err_msg_size,
clow, chigh) == FAILURE)
{
- free_mem (obj_name);
+ free (obj_name);
return FAILURE;
}
if (dtp->u.p.input_complete)
{
- free_mem (obj_name);
+ free (obj_name);
return SUCCESS;
}
}
- free_mem (obj_name);
+ free (obj_name);
goto incr_idx;
default:
diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c
index 73885579997..9e7e9513e07 100644
--- a/libgfortran/io/lock.c
+++ b/libgfortran/io/lock.c
@@ -1,8 +1,9 @@
/* Thread/recursion locking
- Copyright 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org> and Andy Vaught
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
@@ -25,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "io.h"
#include <string.h>
+#include <stdlib.h>
/* library_start()-- Called with a library call is entered. */
@@ -52,13 +54,13 @@ free_ionml (st_parameter_dt *dtp)
{
t2 = t1;
t1 = t1->next;
- free_mem (t2->var_name);
+ free (t2->var_name);
if (t2->var_rank)
{
- free_mem (t2->dim);
- free_mem (t2->ls);
+ free (t2->dim);
+ free (t2->ls);
}
- free_mem (t2);
+ free (t2);
}
}
dtp->u.p.ionml = NULL;
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index bca21062956..be8f4bb0b43 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -1,9 +1,9 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
+/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <unistd.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
static const st_option access_opt[] = {
@@ -623,7 +624,7 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags)
test_endfile (u);
if (flags->status == STATUS_SCRATCH && opp->file != NULL)
- free_mem (opp->file);
+ free (opp->file);
if (flags->form == FORM_FORMATTED)
{
@@ -644,7 +645,7 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags)
/* Free memory associated with a temporary filename. */
if (flags->status == STATUS_SCRATCH && opp->file != NULL)
- free_mem (opp->file);
+ free (opp->file);
fail:
@@ -689,7 +690,7 @@ already_open (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
u->s = NULL;
if (u->file)
- free_mem (u->file);
+ free (u->file);
u->file = NULL;
u->file_len = 0;
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index 3eb66e9d26d..bbe112010ba 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -1,8 +1,9 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -210,7 +211,7 @@ static void
destroy_unit_mutex (gfc_unit * u)
{
__gthread_mutex_destroy (&u->lock);
- free_mem (u);
+ free (u);
}
@@ -473,10 +474,10 @@ free_internal_unit (st_parameter_dt *dtp)
if (dtp->u.p.current_unit != NULL)
{
if (dtp->u.p.current_unit->ls != NULL)
- free_mem (dtp->u.p.current_unit->ls);
+ free (dtp->u.p.current_unit->ls);
if (dtp->u.p.current_unit->s)
- free_mem (dtp->u.p.current_unit->s);
+ free (dtp->u.p.current_unit->s);
destroy_unit_mutex (dtp->u.p.current_unit);
}
@@ -642,7 +643,7 @@ close_unit_1 (gfc_unit *u, int locked)
delete_unit (u);
if (u->file)
- free_mem (u->file);
+ free (u->file);
u->file = NULL;
u->file_len = 0;
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 9ab5bcdbc56..f0cd3b9b16c 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -3,7 +3,7 @@
Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -351,7 +351,7 @@ raw_close (unix_stream * s)
retval = close (s->fd);
else
retval = 0;
- free_mem (s);
+ free (s);
return retval;
}
@@ -564,7 +564,7 @@ buf_close (unix_stream * s)
{
if (buf_flush (s) != 0)
return -1;
- free_mem (s->buffer);
+ free (s->buffer);
return raw_close (s);
}
@@ -739,7 +739,7 @@ static int
mem_close (unix_stream * s)
{
if (s != NULL)
- free_mem (s);
+ free (s);
return 0;
}
@@ -937,7 +937,7 @@ tempfile (st_parameter_open *opp)
#endif /* HAVE_MKSTEMP */
if (fd < 0)
- free_mem (template);
+ free (template);
else
{
opp->file = template;
@@ -1395,7 +1395,7 @@ retry:
__gthread_mutex_lock (&unit_lock);
__gthread_mutex_unlock (&u->lock);
if (predec_waiting_locked (u) == 0)
- free_mem (u);
+ free (u);
goto retry;
}
@@ -1460,7 +1460,7 @@ flush_all_units (void)
__gthread_mutex_lock (&unit_lock);
__gthread_mutex_unlock (&u->lock);
if (predec_waiting_locked (u) == 0)
- free_mem (u);
+ free (u);
}
}
while (1);
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index fa31b98665b..ee2ce0c3915 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -1,10 +1,10 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
Namelist output contributed by Paul Thomas
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1683,8 +1683,8 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
obj, ext_name);
}
- free_mem (obj_name);
- free_mem (ext_name);
+ free (obj_name);
+ free (ext_name);
goto obj_loop;
default:
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index b945eb012db..45c2a17a50d 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -3,7 +3,7 @@
Write float code factoring to this file by Jerry DeLisle
F2003 I/O support contributed by Jerry DeLisle
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -743,7 +743,7 @@ output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \
edigits);\
dtp->u.p.scale_factor = save_scale_factor;\
\
- free_mem(newf);\
+ free (newf);\
\
if (nb > 0 && !dtp->u.p.g0_no_blanks)\
{ \
OpenPOWER on IntegriCloud