Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.166
 
1.167
 
MAIN:ragge:20070825055933
 
pftn.c
_>14251425 void
 14261426 nidcl(NODE *p, int class)
 14271427 {
<> 1428+        struct symtab *sp;
14281429         int commflag = 0;
 14291430 
 14301431         /* compute class */
     
 !
14391440 
 14401441         defid(p, class);
 14411442 
<> 1443+        sp = p->n_sp;
  1444+        /* check if forward decl */
  1445+        if (ISARY(sp->stype) && sp->sdf->ddim == 0)
  1446+                return;
  1447+
14421448         switch (class) {
 14431449         case EXTDEF:
 14441450                 /* simulate initialization by 0 */
     
 !
17031709 /*
 17041710  * Retrieve all CM-separated argument types, sizes and dimensions and
 17051711  * put them in an array.
<> 1712+ * XXX - can only check first type level, side effects?
17061713  */
 17071714 static union arglist *
 17081715 arglist(NODE *n)
     
 !
17731780                         al[k++].df = ap[j]->n_df;
 17741781         }
 17751782         al[k++].type = TNULL;
<> 1783+        if (k > num)
  1784+                cerror("arglist: k%d > num%d", k, num);
17761785         tfree(n);
 17771786         return al;
 17781787 }
     
 !
18931902 }
 18941903 #endif
 18951904 
<> 1905+#ifdef PCC_DEBUG
18961906 /*
<> 1907+ * Print a prototype.
  1908+ */
  1909+static void
  1910+alprint(union arglist *al, int in)
  1911+{
  1912+        int i = 0, j;
  1913+
  1914+        for (; al->type != TNULL; al++) {
  1915+                for (j = in; j > 0; j--)
  1916+                        printf("  ");
  1917+                printf("arg %d: ", i++);
  1918+                tprint(stdout, al->type, 0);
  1919+                if (BTYPE(al->type) == STRTY ||
  1920+                    BTYPE(al->type) == UNIONTY || BTYPE(al->type) == ENUMTY) {
  1921+                        al++;
  1922+                        printf("dim %d\n", al->df->ddim);
  1923+                }
  1924+                printf("\n");
  1925+                if (ISFTN(DECREF(al->type))) {
  1926+                        al++;
  1927+                        alprint(al->df->dfun, in+1);
  1928+                }
  1929+        }
  1930+        if (in == 0)
  1931+                printf("end arglist\n");
  1932+}
  1933+#endif
  1934+/*
18971935  * Do prototype checking and add conversions before calling a function.
 18981936  * Argument f is function and a is a CM-separated list of arguments.
 18991937  * Returns a merged node (via buildtree() of function and arguments.
     
 !
19101948         int argidx/* , hasarray = 0*/;
 19111949         TWORD type, arrt;
 19121950 
<> 1951+#ifdef PCC_DEBUG
  1952+        if (ddebug) {
  1953+                printf("doacall.\n");
  1954+                fwalk(f, eprint, 0);
  1955+                fwalk(a, eprint, 0);
  1956+        }
  1957+#endif
19131958         /* First let MD code do something */
 19141959         calldec(f, a);
 19151960 
     
 !
19531998                         goto build;
 19541999                 }
 19552000         }
<> 2001+#ifdef PCC_DEBUG
  2002+        if (pdebug) {
  2003+                printf("arglist for %s\n",
  2004+                    f->n_sp != NULL ? f->n_sp->sname : "function pointer");
  2005+                alprint(al, 0);
  2006+        }
  2007+#endif
19562008 
 19572009         /*
 19582010          * Create a list of pointers to the nodes given as arg.
     
 !
20632115                         al++;
 20642116 #else
 20652117                 while (arrt > BTMASK) {
<>2066 -                        if (ISARY(arrt) || ISFTN(arrt))
  2118+                        if (ISARY(arrt) || ISFTN(arrt)) {
20672119                                 al++;
<> 2120+                                break;
  2121+                        }
<_20682122                         arrt = DECREF(arrt);
 20692123                 }
 20702124 #endif
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-30 14:17 +0200