From 3a6db389b250439a0cce6b45ef1424a5728f5d18 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Thu, 12 Jan 2023 03:01:34 +0000 Subject: more fixing --- unsorted/Option.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'unsorted/Option.c') diff --git a/unsorted/Option.c b/unsorted/Option.c index e4851dc..2a53f38 100644 --- a/unsorted/Option.c +++ b/unsorted/Option.c @@ -82,13 +82,12 @@ int Args_StackSize(void) { void Args_Push(short flags, void *first, void *second) { OS_ASSERT(104, oStackPtr 0) - { + if (oStackPtr > 0) { short prev = (flags & ARGFLAG_1) ? ARGFLAG_2 : (flags & ARGFLAG_2) ? ARGFLAG_1 : (flags & ARGFLAG_4) ? ARGFLAG_2 : -1; - OPTION_ASSERT(oStack[oStackPtr-1].flags & prev); + OS_ASSERT(111, oStack[oStackPtr-1].flags & prev); } oStack[oStackPtr].e.v.first = first; @@ -97,11 +96,10 @@ void Args_Push(short flags, void *first, void *second) { oStackPtr++; } -Opt48 *Args_Pop(short flags) -{ - OPTION_ASSERT(oStackPtr>0); +Opt48 *Args_Pop(short flags) { + OS_ASSERT(122, oStackPtr>0); --oStackPtr; - OPTION_ASSERT(oStack[oStackPtr].flags & flags); + OS_ASSERT(124, oStack[oStackPtr].flags & flags); return &oStack[oStackPtr]; } @@ -374,7 +372,13 @@ static Boolean Option_ContinuesThisLevel(int level, ArgToken *tok) { } } -static short endingStack[5][3]; +static short endingStack[5][3] = { + ATK_END, ATK_END, ATK_END, + ATK_ARG_END, ATK_COMMA, ATK_OPTION, + ATK_COMMA, ATK_END, ATK_END, + ATK_EQUALS, ATK_END, ATK_END, + ATK_END, ATK_END, ATK_END +}; static Boolean Option_IsEndingThisLevel(int level, ArgToken *tok) { ArgToken *tmp; -- cgit v1.2.3