From 012bb3e61e5eced6c610f9e036372bf0c8def2d1 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 5 Oct 2000 01:18:40 +0000 Subject: Merge with Linux 2.4.0-test9. Please check DECstation, I had a number of rejects to fixup while integrating Linus patches. I also found that this kernel will only boot SMP on Origin; the UP kernel freeze soon after bootup with SCSI timeout messages. I commit this anyway since I found that the last CVS versions had the same problem. --- scripts/mkdep.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'scripts/mkdep.c') diff --git a/scripts/mkdep.c b/scripts/mkdep.c index b11406cdb..34bc174cc 100644 --- a/scripts/mkdep.c +++ b/scripts/mkdep.c @@ -81,15 +81,9 @@ do_depname(void) */ void grow_config(int len) { - if (str_config == NULL) { - len_config = 0; - size_config = 4096; - str_config = malloc(4096); - if (str_config == NULL) - { perror("malloc"); exit(1); } - } - while (len_config + len > size_config) { + if (size_config == 0) + size_config = 2048; str_config = realloc(str_config, size_config *= 2); if (str_config == NULL) { perror("malloc config"); exit(1); } @@ -157,15 +151,9 @@ int len_precious = 0; */ void grow_precious(int len) { - if (str_precious == NULL) { - len_precious = 0; - size_precious = 4096; - str_precious = malloc(4096); - if (str_precious == NULL) - { perror("malloc precious"); exit(1); } - } - while (len_precious + len > size_precious) { + if (size_precious == 0) + size_precious = 2048; str_precious = realloc(str_precious, size_precious *= 2); if (str_precious == NULL) { perror("malloc"); exit(1); } @@ -294,6 +282,7 @@ void use_config(const char * name, int len) * The state machine looks for (approximately) these Perl regular expressions: * * m|\/\*.*?\*\/| + * m|\/\/.*| * m|'.*?'| * m|".*?"| * m|#\s*include\s*"(.*?)"| @@ -326,9 +315,18 @@ __start: CASE('C', cee); goto start; +/* // */ +slash_slash: + GETNEXT + CASE('\n', start); + NOTCASE('\\', slash_slash); + GETNEXT + goto slash_slash; + /* / */ slash: GETNEXT + CASE('/', slash_slash); NOTCASE('*', __start); slash_star_dot_star: GETNEXT -- cgit v1.2.3