mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
1.80 readme and filter for it
don't know why this wasn't commited back in 2010.. git-svn-id: file:///home/notaz/opt/svn/PicoDrive@927 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
40a91e5cc8
commit
39e5b215d3
2 changed files with 88 additions and 46 deletions
|
@ -25,17 +25,19 @@ static int check_defines(const char **defs, int defcount, char *tdef)
|
|||
|
||||
static void do_counters(char *str)
|
||||
{
|
||||
static int counters[4] = { 1, 1, 1, 1 };
|
||||
static int counter_id = -1, counter;
|
||||
char buff[1024];
|
||||
int counter;
|
||||
char *s = str;
|
||||
|
||||
while ((s = strstr(s, "@@")))
|
||||
{
|
||||
if (s[2] < '0' || s[2] > '3') { s++; continue; }
|
||||
if (s[2] < '0' || s[2] > '9') { s++; continue; }
|
||||
|
||||
counter = s[2] - '0';
|
||||
snprintf(buff, sizeof(buff), "%i%s", counters[counter]++, s + 3);
|
||||
if (counter_id != s[2] - '0') {
|
||||
counter_id = s[2] - '0';
|
||||
counter = 1;
|
||||
}
|
||||
snprintf(buff, sizeof(buff), "%i%s", counter++, s + 3);
|
||||
strcpy(s, buff);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue