Compiling for ISO C90 prohibits casting to long long and printing with
"%lld", and printing as "%ld" is wrong on Mac OS where David reports
off_t is long long.
#include <h/mh.h>
#include <h/mts.h>
#include <h/utils.h>
#include <h/mh.h>
#include <h/mts.h>
#include <h/utils.h>
chunks of size MSG_INPUT_SIZE. */
off = pos / MSG_INPUT_SIZE * MSG_INPUT_SIZE;
if (fseeko(iob, off, SEEK_SET) == -1)
chunks of size MSG_INPUT_SIZE. */
off = pos / MSG_INPUT_SIZE * MSG_INPUT_SIZE;
if (fseeko(iob, off, SEEK_SET) == -1)
- adios("getfld's iob", "failed to set offset to skip: %ld",
- off);
+ adios("getfld's iob", "failed to set offset to skip: "
+ "%" PRIdMAX, (intmax_t)off);
num_read = fread (s->msg_buf, 1, MSG_INPUT_SIZE, iob);
s->readpos = s->msg_buf + pos % MSG_INPUT_SIZE;
s->end = s->msg_buf + num_read;
num_read = fread (s->msg_buf, 1, MSG_INPUT_SIZE, iob);
s->readpos = s->msg_buf + pos % MSG_INPUT_SIZE;
s->end = s->msg_buf + num_read;
}
if (fseeko(iob, pos, SEEK_SET) == -1)
}
if (fseeko(iob, pos, SEEK_SET) == -1)
- adios("getfld's iob", "failed to set offset on entry: %ld", pos);
+ adios("getfld's iob", "failed to set offset on entry: %" PRIdMAX,
+ (intmax_t)pos);
/* Set file stream position so that callers can use ftell(). */
if (fseeko(s->iob, s->total_bytes_read, SEEK_SET) == -1)
/* Set file stream position so that callers can use ftell(). */
if (fseeko(s->iob, s->total_bytes_read, SEEK_SET) == -1)
- adios("getfld's iob", "failed to set offset: %ld",
- s->total_bytes_read);
+ adios("getfld's iob", "failed to set offset: %" PRIdMAX,
+ (intmax_t)s->total_bytes_read);
s->last_caller_pos = s->total_bytes_read;
}
s->last_caller_pos = s->total_bytes_read;
}