Skip to content

Commit f87a3b4

Browse files
committed
[class] Whitespace fixes around punctuators
1 parent c1d93b9 commit f87a3b4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

source/classes.tex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -894,25 +894,25 @@
894894
};
895895

896896
void tnode::set(const char* w, tnode* l, tnode* r) {
897-
count = strlen(w)+1;
898-
if (sizeof(tword)<=count)
897+
count = strlen(w) + 1;
898+
if (sizeof(tword) <= count)
899899
perror("tnode string too long");
900-
strcpy(tword,w);
900+
strcpy(tword, w);
901901
left = l;
902902
right = r;
903903
}
904904

905905
void f(tnode n1, tnode n2) {
906-
n1.set("abc",&n2,0);
907-
n2.set("def",0,0);
906+
n1.set("abc", &n2, 0);
907+
n2.set("def", 0, 0);
908908
}
909909
\end{codeblock}
910910

911911
In the body of the member function \tcode{tnode::set}, the member names
912912
\tcode{tword}, \tcode{count}, \tcode{left}, and \tcode{right} refer to
913913
members of the object for which the function is called. Thus, in the
914-
call \tcode{n1.set("abc",\&n2,0)}, \tcode{tword} refers to
915-
\tcode{n1.tword}, and in the call \tcode{n2.set("def",0,0)}, it refers
914+
call \tcode{n1.set("abc", \&n2, 0)}, \tcode{tword} refers to
915+
\tcode{n1.tword}, and in the call \tcode{n2.set("def", 0, 0)}, it refers
916916
to \tcode{n2.tword}. The functions \tcode{strlen}, \tcode{perror}, and
917917
\tcode{strcpy} are not members of the class \tcode{tnode} and should be
918918
declared elsewhere.\footnote{See, for example, \tcode{<cstring>}~(\ref{c.strings}).}
@@ -1476,7 +1476,7 @@
14761476
\enterexample
14771477

14781478
\begin{codeblock}
1479-
enum BOOL { FALSE=0, TRUE=1 };
1479+
enum BOOL { FALSE = 0, TRUE = 1 };
14801480
struct A {
14811481
BOOL b:1;
14821482
};

0 commit comments

Comments
 (0)