summaryrefslogtreecommitdiff
path: root/gl/lib/randread.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-22 18:56:06 +0200
committerJim Meyering <meyering@redhat.com>2009-08-25 09:21:00 +0200
commit5e778f7c8d1ecf3d8f11385db013af2ba026e2a5 (patch)
treee460d471f37f0dce1ba06f60f88114d1a65326c4 /gl/lib/randread.c
parent2bc0f3caaafeb240cdcfd050b7ad1fe0ad14addf (diff)
downloadcoreutils-5e778f7c8d1ecf3d8f11385db013af2ba026e2a5.tar.xz
global: convert indentation-TABs to spaces
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
Diffstat (limited to 'gl/lib/randread.c')
-rw-r--r--gl/lib/randread.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/gl/lib/randread.c b/gl/lib/randread.c
index 48ce92e9a..72475017e 100644
--- a/gl/lib/randread.c
+++ b/gl/lib/randread.c
@@ -100,8 +100,8 @@ struct randread_source
/* Up to a buffer's worth of pseudorandom data. */
union
{
- uint32_t w[ISAAC_WORDS];
- unsigned char b[ISAAC_BYTES];
+ uint32_t w[ISAAC_WORDS];
+ unsigned char b[ISAAC_BYTES];
} data;
} isaac;
} buf;
@@ -115,8 +115,8 @@ randread_error (void const *file_name)
{
if (file_name)
error (exit_failure, errno,
- _(errno == 0 ? "%s: end of file" : "%s: read error"),
- quotearg_colon (file_name));
+ _(errno == 0 ? "%s: end of file" : "%s: read error"),
+ quotearg_colon (file_name));
abort ();
}
@@ -155,18 +155,18 @@ randread_new (char const *name, size_t bytes_bound)
struct randread_source *s;
if (name)
- if (! (source = fopen_safer (name, "rb")))
- return NULL;
+ if (! (source = fopen_safer (name, "rb")))
+ return NULL;
s = simple_new (source, name);
if (source)
- setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound));
+ setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound));
else
- {
- s->buf.isaac.buffered = 0;
- isaac_seed (&s->buf.isaac.state);
- }
+ {
+ s->buf.isaac.buffered = 0;
+ isaac_seed (&s->buf.isaac.state);
+ }
return s;
}
@@ -206,7 +206,7 @@ readsource (struct randread_source *s, unsigned char *p, size_t size)
p += inbytes;
size -= inbytes;
if (size == 0)
- break;
+ break;
errno = (ferror (s->source) ? fread_errno : 0);
s->handler (s->handler_arg);
}
@@ -224,34 +224,34 @@ readisaac (struct isaac *isaac, unsigned char *p, size_t size)
for (;;)
{
if (size <= inbytes)
- {
- memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, size);
- isaac->buffered = inbytes - size;
- return;
- }
+ {
+ memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, size);
+ isaac->buffered = inbytes - size;
+ return;
+ }
memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, inbytes);
p += inbytes;
size -= inbytes;
/* If P is aligned, write to *P directly to avoid the overhead
- of copying from the buffer. */
+ of copying from the buffer. */
if (ALIGNED_POINTER (p, uint32_t))
- {
- uint32_t *wp = (uint32_t *) p;
- while (ISAAC_BYTES <= size)
- {
- isaac_refill (&isaac->state, wp);
- wp += ISAAC_WORDS;
- size -= ISAAC_BYTES;
- if (size == 0)
- {
- isaac->buffered = 0;
- return;
- }
- }
- p = (unsigned char *) wp;
- }
+ {
+ uint32_t *wp = (uint32_t *) p;
+ while (ISAAC_BYTES <= size)
+ {
+ isaac_refill (&isaac->state, wp);
+ wp += ISAAC_WORDS;
+ size -= ISAAC_BYTES;
+ if (size == 0)
+ {
+ isaac->buffered = 0;
+ return;
+ }
+ }
+ p = (unsigned char *) wp;
+ }
isaac_refill (&isaac->state, isaac->data.w);
inbytes = ISAAC_BYTES;