Revision 0bfcd599 qemu-io.c

b/qemu-io.c
84 84
	for (i = 0, p = buffer; i < len; i += 16) {
85 85
		const uint8_t *s = p;
86 86

  
87
		printf("%08llx:  ", (unsigned long long)offset + i);
87
                printf("%08" PRIx64 ":  ", offset + i);
88 88
		for (j = 0; j < 16 && i + j < len; j++, p++)
89 89
			printf("%02x ", *p);
90 90
		printf(" ");
......
108 108
	if (!Cflag) {
109 109
		cvtstr((double)total, s1, sizeof(s1));
110 110
		cvtstr(tdiv((double)total, *t), s2, sizeof(s2));
111
		printf("%s %d/%d bytes at offset %lld\n",
112
			op, total, count, (long long)offset);
111
                printf("%s %d/%d bytes at offset %" PRId64 "\n",
112
                       op, total, count, offset);
113 113
		printf("%s, %d ops; %s (%s/sec and %.4f ops/sec)\n",
114 114
			s1, cnt, ts, s2, tdiv((double)cnt, *t));
115 115
	} else {/* bytes,ops,time,bytes/sec,ops/sec */
......
135 135

  
136 136
	for (i = 0; i < nr_iov; i++) {
137 137
		char *arg = argv[i];
138
		long long len;
138
                uint64_t len;
139 139

  
140 140
		len = cvtnum(arg);
141 141
		if (len < 0) {
......
150 150
		}
151 151

  
152 152
		if (len & 0x1ff) {
153
			printf("length argument %lld is not sector aligned\n",
154
				len);
153
                        printf("length argument %" PRId64
154
                               " is not sector aligned\n", len);
155 155
			goto fail;
156 156
		}
157 157

  
......
398 398

  
399 399
	if (!pflag)
400 400
		if (offset & 0x1ff) {
401
			printf("offset %lld is not sector aligned\n",
402
				(long long)offset);
401
                        printf("offset %" PRId64 " is not sector aligned\n",
402
                               offset);
403 403
			return 0;
404 404

  
405 405
		if (count & 0x1ff) {
......
429 429
		void* cmp_buf = malloc(pattern_count);
430 430
		memset(cmp_buf, pattern, pattern_count);
431 431
		if (memcmp(buf + pattern_offset, cmp_buf, pattern_count)) {
432
			printf("Pattern verification failed at offset %lld, "
433
				"%d bytes\n",
434
				(long long) offset + pattern_offset, pattern_count);
432
			printf("Pattern verification failed at offset %"
433
                               PRId64 ", %d bytes\n",
434
                               offset + pattern_offset, pattern_count);
435 435
		}
436 436
		free(cmp_buf);
437 437
	}
......
533 533
	optind++;
534 534

  
535 535
	if (offset & 0x1ff) {
536
		printf("offset %lld is not sector aligned\n",
537
			(long long)offset);
536
                printf("offset %" PRId64 " is not sector aligned\n",
537
                       offset);
538 538
		return 0;
539 539
	}
540 540

  
......
554 554
		void* cmp_buf = malloc(qiov.size);
555 555
		memset(cmp_buf, pattern, qiov.size);
556 556
		if (memcmp(buf, cmp_buf, qiov.size)) {
557
			printf("Pattern verification failed at offset %lld, "
558
				"%zd bytes\n",
559
				(long long) offset, qiov.size);
557
			printf("Pattern verification failed at offset %"
558
                               PRId64 ", %zd bytes\n",
559
                               offset, qiov.size);
560 560
		}
561 561
		free(cmp_buf);
562 562
	}
......
669 669

  
670 670
	if (!pflag) {
671 671
		if (offset & 0x1ff) {
672
			printf("offset %lld is not sector aligned\n",
673
				(long long)offset);
672
                        printf("offset %" PRId64 " is not sector aligned\n",
673
                               offset);
674 674
			return 0;
675 675
		}
676 676

  
......
783 783
	optind++;
784 784

  
785 785
	if (offset & 0x1ff) {
786
		printf("offset %lld is not sector aligned\n",
787
			(long long)offset);
786
                printf("offset %" PRId64 " is not sector aligned\n",
787
                       offset);
788 788
		return 0;
789 789
	}
790 790

  
......
868 868

  
869 869
		memset(cmp_buf, ctx->pattern, ctx->qiov.size);
870 870
		if (memcmp(ctx->buf, cmp_buf, ctx->qiov.size)) {
871
			printf("Pattern verification failed at offset %lld, "
872
				"%zd bytes\n",
873
				(long long) ctx->offset, ctx->qiov.size);
871
			printf("Pattern verification failed at offset %"
872
                               PRId64 ", %zd bytes\n",
873
                               ctx->offset, ctx->qiov.size);
874 874
		}
875 875
		free(cmp_buf);
876 876
	}
......
969 969
	optind++;
970 970

  
971 971
	if (ctx->offset & 0x1ff) {
972
		printf("offset %lld is not sector aligned\n",
973
			(long long)ctx->offset);
972
		printf("offset %" PRId64 " is not sector aligned\n",
973
                       ctx->offset);
974 974
		free(ctx);
975 975
		return 0;
976 976
	}
......
1064 1064
	optind++;
1065 1065

  
1066 1066
	if (ctx->offset & 0x1ff) {
1067
		printf("offset %lld is not sector aligned\n",
1068
			(long long)ctx->offset);
1067
		printf("offset %" PRId64 " is not sector aligned\n",
1068
                       ctx->offset);
1069 1069
		free(ctx);
1070 1070
		return 0;
1071 1071
	}
......
1214 1214

  
1215 1215
	offset = cvtnum(argv[1]);
1216 1216
	if (offset & 0x1ff) {
1217
		printf("offset %lld is not sector aligned\n",
1218
			(long long)offset);
1217
                printf("offset %" PRId64 " is not sector aligned\n",
1218
                       offset);
1219 1219
		return 0;
1220 1220
	}
1221 1221

  

Also available in: Unified diff