• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionaba28c7a09dcd0a89f1553aca63a956483c7a825 (tree)
Time2020-11-20 22:00:33
Authordhrname <dhrname@user...>
Commiterdhrname

Log Message

Add this pointer

Change Summary

Incremental Difference

--- a/joestar/cpp/Makefile
+++ b/joestar/cpp/Makefile
@@ -4,7 +4,7 @@ NODEBUGMODE = -std=c++20
44 SHELL = /bin/sh
55
66
7-all : main joestar.exe
7+all : joestar.exe
88 .PHONY : all
99
1010
--- a/joestar/cpp/main.cpp
+++ b/joestar/cpp/main.cpp
@@ -35,9 +35,10 @@ public:
3535 virtual Node* getPrev() = 0;
3636 virtual Node* getFirstChild() = 0;
3737 virtual Node* getLastChild() = 0;
38+ virtual Node* removeChild(Node*) = 0;
3839 virtual Node* insertBefore(Node*) = 0;
3940 virtual Node* appendChild(Node*) = 0;
40- virtual bool isNode() const = 0;
41+ virtual bool isNode() = 0;
4142 };
4243
4344 /*空のノードクラス*/
@@ -49,9 +50,10 @@ public:
4950 Node* getPrev(){return this;};
5051 Node* getFirstChild(){return this;};
5152 Node* getLastChild(){return this;};
53+ Node* removeChild(Node*){return this;};
5254 Node* insertBefore(Node*){return this;};
5355 Node* appendChild(Node*){return this;};
54- bool isNode() const
56+ bool isNode()
5557 {
5658 return false;
5759 }
@@ -61,7 +63,7 @@ Node* const emptynode = new EmptyNode();
6163
6264 /*BaseNodeの基底クラス
6365 * Node抽象クラスに対する内部実装*/
64-class BaseNode: public Node
66+class BaseNode: public EmptyNode
6567 {
6668 private:
6769 Node* parentNode;
@@ -86,7 +88,15 @@ public:
8688 virtual void setPrev(Node* node);
8789 virtual void setFirstChild(Node* node);
8890 virtual void setLastChild(Node* node);
89- bool isNode()
91+ virtual Node* getParent();
92+ virtual Node* getNext();
93+ virtual Node* getPrev();
94+ virtual Node* getFirstChild();
95+ virtual Node* getLastChild();
96+ virtual Node* removeChild(Node*);
97+ virtual Node* insertBefore(Node*);
98+ virtual Node* appendChild(Node*);
99+ virtual bool isNode()
90100 {
91101 return true;
92102 }
@@ -95,24 +105,57 @@ public:
95105
96106
97107 void BaseNode::setParent(Node* node){
98- parentNode = node;
108+ this->parentNode = node;
99109 }
100110 void BaseNode::setNext(Node* node){
101- nextSibling = node;
111+ this->nextSibling = node;
102112 }
103113 void BaseNode::setPrev(Node* node){
104- previousSibling = node;
114+ this->previousSibling = node;
105115 }
106116 void BaseNode::setFirstChild(Node* node){
107- firstChild = node;
117+ this->firstChild = node;
108118 }
109119 void BaseNode::setLastChild(Node* node){
110- lastChild = node;
120+ this->lastChild = node;
121+}
122+
123+Node* BaseNode::getParent()
124+{
125+ return this->parentNode;
126+}
127+Node* BaseNode::getNext()
128+{
129+ return this->nextSibling;
130+}
131+Node* BaseNode::getPrev()
132+{
133+ return this->previousSibling;
134+}
135+Node* BaseNode::getFirstChild()
136+{
137+ return this->firstChild;
138+}
139+Node* BaseNode::getLastChild()
140+{
141+ return this->lastChild;
142+}
143+Node* BaseNode::removeChild(Node* const node)
144+{
145+ return this->parentNode;
146+}
147+Node* BaseNode::insertBefore(Node* const node)
148+{
149+ return this->parentNode;
150+}
151+Node* BaseNode::appendChild(Node* const node)
152+{
153+ return this->parentNode;
111154 }
112155
113156 int main(int argc, char **argv)
114157 {
115- std::string str1 = "ABCDE";
158+ std::string str1 = "ABCD";
116159 std::cout << str1 << std::endl;
117160 return 0;
118161 }
Binary files a/source_code/exception.o and b/source_code/exception.o differ
Binary files a/source_code/item.o and b/source_code/item.o differ
Binary files a/source_code/ntree.o and b/source_code/ntree.o differ
--- a/source_code/pair.c
+++ b/source_code/pair.c
@@ -101,7 +101,6 @@ void *ST_emalloc(size_t n)
101101 p = calloc(1, n);
102102 if (p == NULL)
103103 {
104- errno = ENOBUFS;
105104 eprintf("%u bytes failed on the function ST_emalloc:", n);
106105 }
107106 return p;
Binary files a/source_code/pair.o and b/source_code/pair.o differ
--- a/source_code/profile.txt
+++ /dev/null
@@ -1,136 +0,0 @@
1-Flat profile:
2-
3-Each sample counts as 0.01 seconds.
4- % cumulative self self total
5- time seconds seconds calls Ts/call Ts/call name
6-
7- % the percentage of the total running time of the
8-time program used by this function.
9-
10-cumulative a running sum of the number of seconds accounted
11- seconds for by this function and those listed above it.
12-
13- self the number of seconds accounted for by this
14-seconds function alone. This is the major sort for this
15- listing.
16-
17-calls the number of times this function was invoked, if
18- this function is profiled, else blank.
19-
20- self the average number of milliseconds spent in this
21-ms/call function per call, if this function is profiled,
22- else blank.
23-
24- total the average number of milliseconds spent in this
25-ms/call function and its descendents per call, if this
26- function is profiled, else blank.
27-
28-name the name of the function. This is the minor sort
29- for this listing. The index shows the location of
30- the function in the gprof listing. If the index is
31- in parenthesis it shows where it would appear in
32- the gprof listing if it were to be printed.
33-
34-Copyright (C) 2012-2014 Free Software Foundation, Inc.
35-
36-Copying and distribution of this file, with or without modification,
37-are permitted in any medium without royalty provided the copyright
38-notice and this notice are preserved.
39-
40- Call graph (explanation follows)
41-
42-
43-granularity: each sample hit covers 4 byte(s) no time propagated
44-
45-index % time self children called name
46-
47- This table describes the call tree of the program, and was sorted by
48- the total amount of time spent in each function and its children.
49-
50- Each entry in this table consists of several lines. The line with the
51- index number at the left hand margin lists the current function.
52- The lines above it list the functions that called this function,
53- and the lines below it list the functions this one called.
54- This line lists:
55- index A unique number given to each element of the table.
56- Index numbers are sorted numerically.
57- The index number is printed next to every function name so
58- it is easier to look up where the function is in the table.
59-
60- % time This is the percentage of the `total' time that was spent
61- in this function and its children. Note that due to
62- different viewpoints, functions excluded by options, etc,
63- these numbers will NOT add up to 100%.
64-
65- self This is the total amount of time spent in this function.
66-
67- children This is the total amount of time propagated into this
68- function by its children.
69-
70- called This is the number of times the function was called.
71- If the function called itself recursively, the number
72- only includes non-recursive calls, and is followed by
73- a `+' and the number of recursive calls.
74-
75- name The name of the current function. The index number is
76- printed after it. If the function is a member of a
77- cycle, the cycle number is printed between the
78- function's name and the index number.
79-
80-
81- For the function's parents, the fields have the following meanings:
82-
83- self This is the amount of time that was propagated directly
84- from the function into this parent.
85-
86- children This is the amount of time that was propagated from
87- the function's children into this parent.
88-
89- called This is the number of times this parent called the
90- function `/' the total number of times the function
91- was called. Recursive calls to the function are not
92- included in the number after the `/'.
93-
94- name This is the name of the parent. The parent's index
95- number is printed after it. If the parent is a
96- member of a cycle, the cycle number is printed between
97- the name and the index number.
98-
99- If the parents of the function cannot be determined, the word
100- `<spontaneous>' is printed in the `name' field, and all the other
101- fields are blank.
102-
103- For the function's children, the fields have the following meanings:
104-
105- self This is the amount of time that was propagated directly
106- from the child into the function.
107-
108- children This is the amount of time that was propagated from the
109- child's children to the function.
110-
111- called This is the number of times the function called
112- this child `/' the total number of times the child
113- was called. Recursive calls by the child are not
114- listed in the number after the `/'.
115-
116- name This is the name of the child. The child's index
117- number is printed after it. If the child is a
118- member of a cycle, the cycle number is printed
119- between the name and the index number.
120-
121- If there are any cycles (circles) in the call graph, there is an
122- entry for the cycle-as-a-whole. This entry shows who called the
123- cycle (as parents) and the members of the cycle (as children.)
124- The `+' recursive calls entry shows the number of function calls that
125- were internal to the cycle, and the calls entry for each member shows,
126- for that member, how many times it was called from other members of
127- the cycle.
128-
129-Copyright (C) 2012-2014 Free Software Foundation, Inc.
130-
131-Copying and distribution of this file, with or without modification,
132-are permitted in any medium without royalty provided the copyright
133-notice and this notice are preserved.
134-
135-Index by function name
136-
Binary files a/source_code/shadowstar.o and b/source_code/shadowstar.o differ
--- a/source_code/star.h
+++ b/source_code/star.h
@@ -19,8 +19,6 @@
1919 #include <float.h>
2020 #include <assert.h>
2121 #include <setjmp.h>
22-#include <unistd.h>
23-#include <sys/time.h>
2422 #include <fcntl.h>
2523 #include <signal.h>
2624
Binary files a/source_code/star.o and b/source_code/star.o differ
Binary files a/source_code/startest.o and b/source_code/startest.o differ