Change some drivers accordingly.
do_write ? FBD_FLAG_WRITE : FBD_FLAG_READ);
#if DEBUG
- printf("FBD: %s operation for pos %lx:%08lx size %u -> hooks %x\n",
- do_write ? "write" : "read", ex64hi(position),
- ex64lo(position), size, hooks);
+ printf("FBD: %s operation for pos %"PRIx64" size %u -> hooks %x\n",
+ do_write ? "write" : "read", position, size, hooks);
#endif
if (hooks & PRE_HOOK)
return RET_REDO;
}
#if DEBUG
- printf("Filter: partition size: 0x%s / %lu sectors\n",
- print64(disk_size), sectors);
+ printf("Filter: partition size: 0x%"PRIx64" / %lu sectors\n",
+ disk_size, sectors);
#endif
} else {
if(cmp64(disk_size, part.size)) {
- printf("Filter: partition size mismatch (%s != %s)\n",
- print64(part.size), print64(disk_size));
+ printf("Filter: partition size mismatch "
+ "(0x%"PRIx64" != 0x%"PRIx64")\n",
+ part.size, disk_size);
return RET_REDO;
}
int r;
#if DEBUG2
- printf("paired_sendrec(%d) - <%d,%x:%x,%d> - %x,%x\n",
+ printf("paired_sendrec(%d) - <%d,%lx:%lx,%d> - %x,%x\n",
both, m1->m_type, m1->BDEV_POS_HI, m1->BDEV_POS_LO,
m1->BDEV_COUNT, m1->BDEV_GRANT, m2->BDEV_GRANT);
#endif
/* util.c */
extern char *flt_malloc(size_t size, char *sbuf, size_t ssize);
extern void flt_free(char *buf, size_t size, const char *sbuf);
-extern char *print64(u64_t p);
extern clock_t flt_alarm(clock_t dt);
r = read_write(phys_pos, ext_buffer, ext_buffer, &res_size, flag_rw);
#if DEBUG2
- printf("Filter: transfer: read_write(%x:%x, %u, %d) = %d, %u\n",
- ex64hi(phys_pos), ex64lo(phys_pos), ext_size, flag_rw, r,
- res_size);
+ printf("Filter: transfer: read_write(%"PRIx64", %u, %d) = %d, %u\n",
+ phys_pos, ext_size, flag_rw, r, res_size);
#endif
if (r != OK) {
free_contig(buf, size);
}
-/*===========================================================================*
- * print64 *
- *===========================================================================*/
-char *print64(u64_t p)
-{
-#define NB 10
- static int n = 0;
- static char buf[NB][100];
- u32_t lo = ex64lo(p), hi = ex64hi(p);
- n = (n+1) % NB;
- if(!hi) sprintf(buf[n], "%x", lo);
- else sprintf(buf[n], "%x%08x", hi, lo);
- return buf[n];
-}
-
/*===========================================================================*
* flt_alarm *
*===========================================================================*/
{
int c, charcount = 0;
enum { LEFT, RIGHT } adjust;
- enum { LONG, INT } intsize;
+ enum { LLONG, LONG, INT } intsize;
int fill;
int width, max, len, base;
static char X2C_tab[]= "0123456789ABCDEF";
static char x2c_tab[]= "0123456789abcdef";
char *x2c;
char *p;
- long i;
- unsigned long u;
- char temp[8 * sizeof(long) / 3 + 2];
+ long long i;
+ unsigned long long u;
+ char temp[8 * sizeof(long long) / 3 + 2];
while ((c= *fmt++) != 0) {
if (c != '%') {
intsize= LONG;
c= *fmt++;
}
+ if (c == 'l' || c == 'L') {
+ /* "Long long" key, e.g. %lld. */
+ intsize= LLONG;
+ c= *fmt++;
+ }
if (c == 0) break;
switch (c) {
/* Decimal. */
case 'd':
- i= intsize == LONG ? va_arg(argp, long)
- : va_arg(argp, int);
+ switch (intsize) {
+ case LLONG: i= va_arg(argp, long long); break;
+ case LONG: i= va_arg(argp, long); break;
+ case INT: i= va_arg(argp, int); break;
+ }
u= i < 0 ? -i : i;
goto int2ascii;
/* Pointer, interpret as %X or %lX. */
case 'p':
- if (sizeof(char *) > sizeof(int)) intsize= LONG;
+ if (sizeof(char *) > sizeof(long)) intsize= LLONG;
+ else if (sizeof(char *) > sizeof(int)) intsize= LONG;
/* Hexadecimal. %X prints upper case A-F, not %lx. */
case 'X':
/* Unsigned decimal. */
case 'u':
getint:
- u= intsize == LONG ? va_arg(argp, unsigned long)
- : va_arg(argp, unsigned int);
+ switch (intsize) {
+ case LLONG: u= va_arg(argp, unsigned long long); break;
+ case LONG: u= va_arg(argp, unsigned long); break;
+ case INT: u= va_arg(argp, unsigned int); break;
+ }
int2ascii:
p= temp + sizeof(temp)-1;
*p= 0;