fixed bugs, added No_Mem()
authoreck <none@none>
Wed, 21 Feb 1990 16:38:45 +0000 (16:38 +0000)
committereck <none@none>
Wed, 21 Feb 1990 16:38:45 +0000 (16:38 +0000)
lang/cem/cpp.ansi/macro.str
lang/cem/cpp.ansi/main.c
lang/cem/cpp.ansi/options.c
lang/cem/cpp.ansi/preprocess.c
lang/cem/cpp.ansi/replace.c

index 391c450..32b867c 100644 (file)
@@ -21,7 +21,6 @@
        formal parameter in this text.
 */
 struct macro   {
-       struct macro *next;
        char *  mc_text;        /* the replacement text         */
        int     mc_nps;         /* number of formal parameters  */
        int     mc_length;      /* length of replacement text   */
index 8a32050..1008665 100644 (file)
@@ -82,3 +82,8 @@ compile(argc, argv)
        if (source) WorkingDir = getwdir(dummy);
        preprocess(source);
 }
+
+No_Mem()                               /* called by alloc package */
+{
+       fatal("out of memory");
+}
index 736078e..5f253c3 100644 (file)
@@ -41,7 +41,7 @@ do_option(text)
        {
                register char *cp = text, *name, *mactext;
 
-               if (class(*cp) != STIDF || class(*cp) == STELL) {
+               if (class(*cp) != STIDF && class(*cp) != STELL) {
                        error("identifier missing in -D%s", text);
                        break;
                }
index d5ed78e..ea4ede0 100644 (file)
@@ -53,7 +53,7 @@ do_pragma()
        *c_ptr = '\0';
        while(c != '\n') {
                if (c_ptr + 1 - cur_line == size) {
-                       cur_line = Realloc(cur_line, size + ITEXTSIZE);
+                       cur_line = Realloc(cur_line, size += ITEXTSIZE);
                        c_ptr = cur_line + size - 1;
                }
                *c_ptr++ = c;
index 81e11b6..3e2c3ac 100644 (file)
@@ -186,9 +186,10 @@ expand_defined(repl)
        }
        UnGetChar();
        str = GetIdentifier(0);
-       if (str)
-               id = str2idf(str, 0);
-       else    id = 0;
+       if (str) {
+               id = findidf(str);
+               free(str);
+       } else  id = 0;
        assert(id || class(ch) == STELL);
        ch = GetChar();
        ch = skipspaces(ch, 0);