> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux
 09:50:01  up 1 day 10:05,  2 users,  load average: 0.38, 0.51, 0.44
This commit is contained in:
tracer-ysyx 2024-01-13 09:50:01 +08:00 committed by xinyangli
parent 0f52515269
commit 44a42b4d3c

View file

@ -29,17 +29,20 @@ void gen(char c) {
}
void gen_num(void) {
int32_t num = rand();
uint32_t num = rand();
int len = 0, ref_len = 0;
switch(rand() % 2) {
switch(rand() % 3) {
case 0:
len = snprintf(buf_ptr, 100, "%d", num);
len = snprintf(buf_ptr, 100, "%u", num);
ref_len = snprintf(ref_buf_ptr, 100, "%uU", num);
break;
case 1:
len = snprintf(buf_ptr, 100, "0x%x", num);
ref_len = snprintf(ref_buf_ptr, 100, "%uU", num);
break;
case 3:
len = snprintf(buf_ptr, 100, "%d", num);
ref_len = snprintf(ref_buf_ptr, 100, "%d", num);
default: assert(0);
}
buf_ptr += len;