diff c/regexParser/node.cc @ 112:ec485345daf9 pairPro

some function use static
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Mon, 23 Nov 2015 15:54:19 +0900
parents a3adc5c24e19
children 66c633575b53
line wrap: on
line diff
--- a/c/regexParser/node.cc	Sat Nov 21 18:04:25 2015 +0900
+++ b/c/regexParser/node.cc	Mon Nov 23 15:54:19 2015 +0900
@@ -1,10 +1,12 @@
 #include <stdio.h>
 #include "regexParser.h"
 
-void descendTree(NodePtr n, int d) {
+static void descendTree(NodePtr,int);
+void printTree(NodePtr);
+
+static void descendTree(NodePtr n, int d) {
     if (n->right != NULL) {
-        d++;
-        descendTree(n->right, d);
+        descendTree(n->right, d+1);
         d--;
     }
     if (n->tokenType == 'a') {
@@ -14,8 +16,7 @@
     }
 
     if (n->left != NULL) {
-        d++;
-        descendTree(n->left, d);
+        descendTree(n->left, d+1);
         d--;
     }
 }