• R/O
  • SSH
  • HTTPS

globalbase: Commit


Commit MetaInfo

Revisão5865 (tree)
Hora2017-07-12 20:58:28
Autorjoshua

Mensagem de Log

tsSystem debug bug

Mudança Sumário

Diff

--- modules/tinyState/trunk/proj/posix/preference.pl (revision 5864)
+++ modules/tinyState/trunk/proj/posix/preference.pl (revision 5865)
@@ -6,7 +6,7 @@
66 ###############################################
77
88 our $fullPackageName = "[tinyState pseudo-coroutine]";
9-our $version = "[0.3.4]";
9+our $version = "[0.3.5]";
1010 our $bugReportAddress = "[http://www.globalbase.org/]";
1111 our $prog = "tinyState";
1212 our $dependency = "customInstall_alternative";
--- modules/tinyState/trunk/src/classes/gt/c++/gtData.cpp (revision 5864)
+++ modules/tinyState/trunk/src/classes/gt/c++/gtData.cpp (revision 5865)
@@ -52,9 +52,6 @@
5252 count = 1;
5353 }
5454
55-uint8_t
56-gtData::debug;
57-
5855 void
5956 gtData::add_backptr(gtData * obj)
6057 {
--- modules/tinyState/trunk/src/classes/ts/c++/sObject.cpp (revision 5864)
+++ modules/tinyState/trunk/src/classes/ts/c++/sObject.cpp (revision 5865)
@@ -142,6 +142,8 @@
142142 }
143143
144144
145+
146+
145147 void *
146148 sObject::operator new(size_t cbSize,const char * __file,int __line)
147149 throw(std::bad_alloc)
--- modules/tinyState/trunk/src/classes/ts/c++/stdObject.cpp (revision 5864)
+++ modules/tinyState/trunk/src/classes/ts/c++/stdObject.cpp (revision 5865)
@@ -1,5 +1,6 @@
11
22 #include <stdio.h>
3+#include <stdlib.h>
34 #include "ts/c++/stdObject.h"
45
56
@@ -14,6 +15,7 @@
1415 {
1516 this->ref = 0;
1617 this->insert_zombie_list();
18+
1719 }
1820
1921
--- modules/tinyState/trunk/src/classes/ts/c++/stdString.cpp (revision 5864)
+++ modules/tinyState/trunk/src/classes/ts/c++/stdString.cpp (revision 5865)
@@ -19,6 +19,7 @@
1919 return;
2020 this->length(strlen(str)+1);
2121 strcpy(&this->ary[0],str);
22+
2223 }
2324
2425 stdString::stdString(stdString * s)
@@ -44,6 +45,7 @@
4445 sprintf(buffer,fmt,data);
4546 length(len=strlen(buffer));
4647 memcpy(&this->ary[0],buffer,len+1);
48+
4749 }
4850
4951 stdString::stdString(const char * fmt,double data)
@@ -57,6 +59,7 @@
5759 sprintf(buffer,fmt,data);
5860 length(len=strlen(buffer));
5961 memcpy(&this->ary[0],buffer,len+1);
62+
6063 }
6164
6265 stdString::stdString(const char * fmt,void * data)
@@ -70,6 +73,7 @@
7073 sprintf(buffer,fmt,data);
7174 length(len=strlen(buffer));
7275 memcpy(&this->ary[0],buffer,len+1);
76+
7377 }
7478
7579 stdString::stdString(char ch)
@@ -78,6 +82,7 @@
7882 {
7983 this->ary[0] = ch;
8084 this->ary[1] = 0;
85+
8186 }
8287
8388 stdString::stdString()
@@ -84,6 +89,7 @@
8489 :
8590 stdArray<char,false>(1)
8691 {
92+
8793 }
8894
8995 stdString::stdString(const char * str,int sp,int ep)
@@ -141,6 +147,10 @@
141147 void
142148 stdString::length(int len)
143149 {
150+ if ( len < 0 ) {
151+ this->stdArray<char,false>::length(-1);
152+ return;
153+ }
144154 this->stdArray<char,false>::length(len+1);
145155 this->ary[len] = 0;
146156 }
@@ -498,3 +508,4 @@
498508 return 0;
499509 return NEW stdString(this,0,rx_work->match->ary[0].rm_so);
500510 }
511+
--- modules/tinyState/trunk/src/classes/ts/c++/tinyState.cpp (revision 5864)
+++ modules/tinyState/trunk/src/classes/ts/c++/tinyState.cpp (revision 5865)
@@ -429,6 +429,7 @@
429429 tinyState_::do_thread(TS_STATE_TYPE state,stdEvent * ev)
430430 {
431431 TS_STATE_FUNC func;
432+TS_STATE_TYPE ret;
432433 func = this->getFunc(state);
433434 return (*func)(this,ev);
434435 }
@@ -583,7 +584,8 @@
583584 void
584585 tinyState_::remove_listener(stdEventHandle * eh)
585586 {
586- (*this->event_listener)[eh->type]->del(eh,0);
587+ if ( (*this->event_listener)[eh->type] )
588+ (*this->event_listener)[eh->type]->del(eh,0);
587589 eh->listener->remove_handle(eh);
588590 if ( check_listener )
589591 wakeup();
--- modules/tinyState/trunk/src/classes/ts/c++/tsSystem.cpp (revision 5864)
+++ modules/tinyState/trunk/src/classes/ts/c++/tsSystem.cpp (revision 5865)
@@ -137,17 +137,6 @@
137137 REF_SET(this->commandLine,NEW stdString(commandLine));
138138 this->ret = this->do_exec(commandLine,fd_r,fd_w,fd_err,dmode);
139139 this->dmode = dmode;
140- if ( this->ret >= 0 ) {
141- sObject::refine_fd(*fd_r,
142- ifp->get_sobj_file(),
143- ifp->get_sobj_line());
144- sObject::refine_fd(*fd_w,
145- ifp->get_sobj_file(),
146- ifp->get_sobj_line());
147- sObject::refine_fd(*fd_err,
148- ifp->get_sobj_file(),
149- ifp->get_sobj_line());
150- }
151140 *retp = ret;
152141 }
153142
--- modules/tinyState/trunk/src/h/gt/c++/gt.h (revision 5864)
+++ modules/tinyState/trunk/src/h/gt/c++/gt.h (revision 5865)
@@ -65,8 +65,6 @@
6565
6666 public:
6767
68- static uint8_t debug;
69-
7068 gtData(short type):
7169 type(type),
7270 flags(0),
@@ -258,12 +256,16 @@
258256 next(0),
259257 str(0)
260258 {
259+
261260 REF_SET(this->str,_str);
262261 }
263262 virtual ~gtDataStringElement() {
264263 REF_SET(str,0);
265264 REF_SET(next,0);
265+
266+
266267 }
268+
267269 };
268270
269271 class gtDataString : public gtData {
--- modules/tinyState/trunk/src/h/ts/c++/sArray.h (revision 5864)
+++ modules/tinyState/trunk/src/h/ts/c++/sArray.h (revision 5865)
@@ -76,8 +76,13 @@
7676 }
7777 void length(int len) {
7878 int i,clen;
79- if ( leng == len )
80- return;
79+ if ( len >= 0 ) {
80+ if ( leng == len )
81+ return;
82+ }
83+ else {
84+ len = leng;
85+ }
8186 __TYPE * tmp = ary;
8287 ary = new (__file,__line) __TYPE[len]();
8388 clen = leng > len ? len : leng;
--- modules/tinyState/trunk/src/h/ts/c++/stdHalfOrderQueue.h (revision 5864)
+++ modules/tinyState/trunk/src/h/ts/c++/stdHalfOrderQueue.h (revision 5865)
@@ -21,6 +21,7 @@
2121 int key;
2222 int count;
2323 stdHalfOrderNode * n[2];
24+
2425 };
2526
2627 class stdHalfOrderQueue : public stdObject {
--- modules/tinyState/trunk/src/h/ts/c++/stdObject.h (revision 5864)
+++ modules/tinyState/trunk/src/h/ts/c++/stdObject.h (revision 5865)
@@ -8,6 +8,7 @@
88 #include "ts/c++/ts_types.h"
99 #include "ts/c++/sObject.h"
1010
11+
1112 class stdObject : public sObject {
1213 public:
1314
@@ -26,6 +27,7 @@
2627 printf(const char * fmt,...);
2728
2829 static const char * trace_all;
30+
2931 protected:
3032 virtual void refNotice() {}
3133 virtual void refNotice1() {}
@@ -43,6 +45,7 @@
4345
4446 static stdObject * zombie_list;
4547 static int zombie_count;
48+
4649 };
4750
4851
@@ -57,7 +60,6 @@
5760 (*_tmp_x) = (_tmp); \
5861 }
5962
60-
6163 #endif
6264
6365
--- modules/tinyState/trunk/src/h/ts/c++/stdString.h (revision 5864)
+++ modules/tinyState/trunk/src/h/ts/c++/stdString.h (revision 5865)
@@ -15,6 +15,8 @@
1515 stdArray<stdString*> * values;
1616 stdArray<regmatch_t,false> * match;
1717
18+ rxWork() {
19+ }
1820 ~rxWork() {
1921 REF_SET(values,0);
2022 REF_SET(match,0);
@@ -37,6 +39,7 @@
3739
3840 ~stdString() {
3941 REF_SET(rx_work,0);
42+
4043 };
4144
4245 int length();
@@ -75,8 +78,10 @@
7578 stdString * rxPrev();
7679
7780 unsigned debug:1;
81+
7882 private:
7983 rxWork * rx_work;
84+
8085 };
8186
8287
Show on old repository browser