> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 16:21:58 up 1 day, 15:12, 1 user, load average: 0.38, 0.31, 0.18
This commit is contained in:
@ -61,11 +61,11 @@ bool wp_check_hit(void) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WP* del_wp(WP* head, WP* pos) {
|
static WP* del_wp(WP** head, WP* pos) {
|
||||||
for (WP** i = &head; (*i) != NULL && (*i)->next != NULL; i = (WP**)*i) {
|
for (WP** i = head; (*i) != NULL && (*i)->next != NULL; i = (WP**)*i) {
|
||||||
if ((**i).NO == pos->NO) {
|
if ((**i).NO == pos->NO) {
|
||||||
WP* res = *i;
|
WP* res = *i;
|
||||||
*i = (**i).next;
|
*i = (*i)->next;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ WP* new_wp(char* _expr, int len) {
|
|||||||
if (!success) {
|
if (!success) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
WP* wp = del_wp(free_, free_);
|
WP* wp = del_wp(&free_, free_);
|
||||||
if (wp == NULL) {
|
if (wp == NULL) {
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ WP* get_wp(int NO) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void free_wp(WP *_wp) {
|
void free_wp(WP *_wp) {
|
||||||
WP* wp = del_wp(head, _wp);
|
WP* wp = del_wp(&head, _wp);
|
||||||
wp->next = free_;
|
wp->next = free_;
|
||||||
free_ = wp;
|
free_ = wp;
|
||||||
wp->expr[0] = '\0';
|
wp->expr[0] = '\0';
|
||||||
|
Reference in New Issue
Block a user