retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
retarray->base = 0;
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
retarray->base = 0;
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else
return val;
}
-/* LAPACK's test programs declares ETIME external, therefore we
+/* LAPACK's test programs declares ETIME external, therefore we
need this. */
extern GFC_REAL_4 etime_ (GFC_REAL_4 *t);
}
/* random_seed is used to seed the PRNG with either a default
- set of seeds or user specified set of seeds. random_seed
+ set of seeds or user specified set of seeds. random_seed
must be called with no argument or exactly one argument. */
void
GFC_INTEGER_4 rec;
GFC_INTEGER_4 *nextrec, *size;
- GFC_INTEGER_4 recl_in;
+ GFC_INTEGER_4 recl_in;
GFC_INTEGER_4 *recl_out;
GFC_INTEGER_4 *iolength;
unit_blank blank_status;
enum {SIGN_S, SIGN_SS, SIGN_SP} sign_status;
int scale_factor;
- jmp_buf eof_jump;
+ jmp_buf eof_jump;
}
global_t;
case BT_CHARACTER:
if (saved_string)
- {
+ {
m = (len < saved_used) ? len : saved_used;
memcpy (p, saved_string, m);
}
- else
+ else
/* Just delimiters encountered, nothing to copy but SPACE. */
m = 0;
/*Check the values of the triplet indices. */
- if ( (ls[dim].start > (ssize_t)ad[dim].ubound)
+ if ( (ls[dim].start > (ssize_t)ad[dim].ubound)
|| (ls[dim].start < (ssize_t)ad[dim].lbound)
|| (ls[dim].end > (ssize_t)ad[dim].ubound)
|| (ls[dim].end < (ssize_t)ad[dim].lbound))
/* Visits all the components of a derived type that have
not explicitly been identified in the namelist input.
- touched is set and the loop specification initialised
+ touched is set and the loop specification initialised
to default values */
static void
pdata = (void*)(pdata + (nl->ls[dim].idx - nl->dim[dim].lbound) *
nl->dim[dim].stride * nl->size);
- /* Reset the error flag and try to read next value, if
+ /* Reset the error flag and try to read next value, if
repeat_count=0 */
nml_read_error = 0;
saved_type = GFC_DTYPE_UNKNOWN;
free_saved ();
-
+
switch (nl->type)
{
case GFC_DTYPE_INTEGER:
/* Now loop over the components. Update the component pointer
with the return value from nml_write_obj. This loop jumps
- past nested derived types by testing if the potential
+ past nested derived types by testing if the potential
component name contains '%'. */
for (cmp = nl->next;
/* The standard permits array data to stop short of the number of
elements specified in the loop specification. In this case, we
- should be here with nml_read_error != 0. Control returns to
+ should be here with nml_read_error != 0. Control returns to
nml_get_obj_data and an attempt is made to read object name. */
prev_nl = nl;
{
if (is_internal_unit())
{
- /* readlen may be modified inside salloc_r if
+ /* readlen may be modified inside salloc_r if
is_internal_unit() is true. */
readlen = 1;
}
file, advancing the current position. We return a pointer to a
buffer containing the bytes. We return NULL on end of record or
end of file.
-
+
If the read is short, then it is because the current record does not
have enough data to satisfy the read request and the file was
opened with PAD=YES. The caller must assume tailing spaces for
else // FMT==T
{
consume_data_flag = 0 ;
- pos = f->u.n - 1;
+ pos = f->u.n - 1;
}
if (pos < 0 || pos >= current_unit->recl )
generate_error (ERROR_OS, NULL);
}
- /* Overwriting an existing sequential file ?
+ /* Overwriting an existing sequential file ?
it is always safe to truncate the file on the first write */
- if (g.mode == WRITING
- && current_unit->flags.access == ACCESS_SEQUENTIAL
+ if (g.mode == WRITING
+ && current_unit->flags.access == ACCESS_SEQUENTIAL
&& current_unit->current_record == 0)
- struncate(current_unit->s);
+ struncate(current_unit->s);
current_unit->mode = g.mode;
{
new = file_position (current_unit->s) + current_unit->bytes_left;
- /* Direct access files do not generate END conditions,
+ /* Direct access files do not generate END conditions,
only I/O errors. */
if (sseek (current_unit->s, new) == FAILURE)
generate_error (ERROR_OS, NULL);
case FORMATTED_SEQUENTIAL:
length = 1;
/* sf_read has already terminated input because of an '\n' */
- if (sf_seen_eor)
+ if (sf_seen_eor)
{
sf_seen_eor=0;
break;
}
if (sfree (current_unit->s) == FAILURE)
- goto io_error;
+ goto io_error;
break;
extern void st_set_nml_var_dim (GFC_INTEGER_4, GFC_INTEGER_4,
GFC_INTEGER_4 ,GFC_INTEGER_4);
export_proto(st_set_nml_var_dim);
-
static void
output_float (fnode *f, double value, int len)
{
- /* This must be large enough to accurately hold any value. */
+ /* This must be large enough to accurately hold any value. */
char buffer[32];
char *out;
char *digits;
if (edigits < 2)
edigits = 2;
}
-
+
if (ft == FMT_F || ft == FMT_EN
|| ((ft == FMT_D || ft == FMT_E) && g.scale_factor != 0))
{
}
sprintf (buffer, "%+-#31.*e", ndigits - 1, value);
-
+
/* Check the resulting string has punctuation in the correct places. */
if (buffer[2] != '.' || buffer[ndigits + 2] != 'e')
internal_error ("printf is broken");
edigits = 1;
for (i = abs (e); i >= 10; i /= 10)
edigits++;
-
+
if (f->u.real.e < 0)
{
/* Width not specified. Must be no more than 3 digits. */
nblanks = w - (nbefore + nzero + nafter + edigits + 1);
if (sign != SIGN_NONE)
nblanks--;
-
+
/* Check the value fits in the specified field width. */
if (nblanks < 0 || edigits == -1)
{
ndigits -= i;
out += nafter;
}
-
+
/* Output the exponent. */
if (expchar)
{
}
memset(p, ' ', nb);
- res = !isnan (n);
+ res = !isnan (n);
if (res != 0)
{
- if (signbit(n))
+ if (signbit(n))
fin = '-';
else
fin = '+';
if (nb > 7)
- memcpy(p + nb - 8, "Infinity", 8);
+ memcpy(p + nb - 8, "Infinity", 8);
else
memcpy(p + nb - 3, "Inf", 3);
if (nb < 8 && nb > 3)
p[nb - 4] = fin;
else if (nb > 8)
- p[nb - 9] = fin;
+ p[nb - 9] = fin;
}
else
memcpy(p + nb - 3, "NaN", 3);
}
num++;
- /* Output the data, if an intrinsic type, or recurse into this
+ /* Output the data, if an intrinsic type, or recurse into this
routine to treat derived types. */
switch (obj->type)
/* To treat a derived type, we need to build two strings:
ext_name = the name, including qualifiers that prepends
- component names in the output - passed to
+ component names in the output - passed to
nml_write_obj.
obj_name = the derived type name with no qualifiers but %
- appended. This is used to identify the
+ appended. This is used to identify the
components. */
/* First ext_name => get length of all possible components */
}
/* This is the entry function for namelist writes. It outputs the name
- of the namelist and iterates through the namelist by calls to
- nml_write_obj. The call below has dummys in the arguments used in
+ of the namelist and iterates through the namelist by calls to
+ nml_write_obj. The call below has dummys in the arguments used in
the treatment of derived types. */
void
}
#undef NML_DIGITS
-
retarray->dim[0].lbound = 0;
retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound;
retarray->dim[0].stride = 1;
-
+
retarray->dim[1].lbound = 0;
retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound;
retarray->dim[1].stride = retarray->dim[0].ubound+1;
}
-
+
retarray->data
= internal_malloc_size (sizeof (rtype_name) * size0 ((array_t *) retarray));
retarray->base = 0;
/* bystride should never be used for 1-dimensional b.
in case it is we want it to cause a segfault, rather than
an incorrect result. */
- bystride = 0xDEADBEEF;
+ bystride = 0xDEADBEEF;
ycount = 1;
}
else