summaryrefslogtreecommitdiffstats
path: root/scripts/mkdep.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
commit012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch)
tree87efc733f9b164e8c85c0336f92c8fb7eff6d183 /scripts/mkdep.c
parent625a1589d3d6464b5d90b8a0918789e3afffd220 (diff)
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.
Diffstat (limited to 'scripts/mkdep.c')
-rw-r--r--scripts/mkdep.c30
1 files changed, 14 insertions, 16 deletions
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