Skip to content

Commit ec727ff

Browse files
committed
Update transition helper
1 parent f152a23 commit ec727ff

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

misc/temp_transition_helper.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <string.h>
44
#include <stdlib.h>
55

6-
const char * yes[] = { "CH32V003" };
7-
const char * no[] = { "CH32V20x", "CH32V30x", "CH32X03x", "CH32V10x" };
6+
const char * yes[] = { "CH32X03x", };
7+
const char * no[] = { "CH32V10x", "CH32V30x", "CH32V20x", "CH32V003" };
88

99
char * WhitePull( const char ** sti )
1010
{
@@ -41,31 +41,33 @@ int EvalSpec( const char * spl )
4141
int lastv = 0;
4242
int lasto = -1;
4343
int ret = 0;
44-
44+
cont:
4545
char * wp = WhitePull( &spl );
4646
int def = -1;
4747
if( strcmp( wp, "defined" ) == 0 ) def = 1;
4848
if( strcmp( wp, "!defined" ) == 0 ) def = 2;
4949
if( def < 0 ) return 2;
5050
char * wpn = WhitePull( &spl );
5151
i = NYI( wpn );
52-
//printf( "SPIN: %s/%s/%d/%d\n", wp, wpn, i, def );
52+
//printf( "SPIN: %s/%s/%d/%d/%d\n", wp, wpn, i, def, lasto );
5353
if( i == 2 ) return 2;
5454

5555
if( def == 2 ) i = !i;
5656

5757
if( lasto == 1 )
5858
ret = lastv || i;
59-
if( lasto == 2 )
59+
else if( lasto == 2 )
6060
ret = lastv && i;
6161
else
6262
ret = i;
6363

6464
char * wpa = WhitePull( &spl );
65+
//printf( "WPA: \"%s\"\n", wpa );
6566
lastv = ret;
6667
lasto = -1;
67-
if( strcmp( wpa, "||" ) ) { lasto = 1; }
68-
else if( strcmp( wpa, "&&" ) ) { lasto = 2; }
68+
//printf( "RET: %d\n", ret );
69+
if( strcmp( wpa, "||" ) == 0 ) { lasto = 1; goto cont; }
70+
else if( strcmp( wpa, "&&" ) == 0 ) { lasto = 2; goto cont; }
6971
else return ret;
7072
}
7173

@@ -104,7 +106,7 @@ int NoYesInd( const char * preprocc )
104106
return ret;
105107
}
106108

107-
const char * sslineis( const char * line, const char * match )
109+
char * sslineis( const char * line, const char * match )
108110
{
109111
while( *line == ' ' || *line == '\t' ) line++;
110112
const char * linestart = line;

0 commit comments

Comments
 (0)