Skip to content

Commit 66fc439

Browse files
committed
Bug fixes for 3.6.0
1 parent c239246 commit 66fc439

File tree

9 files changed

+64
-35
lines changed

9 files changed

+64
-35
lines changed

doxyfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = StratifyAPI
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 2.5.0
41+
PROJECT_NUMBER = 3.6.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a
@@ -2157,7 +2157,7 @@ HIDE_UNDOC_RELATIONS = YES
21572157
# set to NO
21582158
# The default value is: NO.
21592159

2160-
HAVE_DOT = NO
2160+
HAVE_DOT = YES
21612161

21622162
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
21632163
# to run in parallel. When set to 0 doxygen will base this on the number of
@@ -2199,7 +2199,7 @@ DOT_FONTPATH =
21992199
# The default value is: YES.
22002200
# This tag requires that the tag HAVE_DOT is set to YES.
22012201

2202-
CLASS_GRAPH = NO
2202+
CLASS_GRAPH = YES
22032203

22042204
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
22052205
# graph for each documented class showing the direct and indirect implementation
@@ -2215,15 +2215,15 @@ COLLABORATION_GRAPH = NO
22152215
# The default value is: YES.
22162216
# This tag requires that the tag HAVE_DOT is set to YES.
22172217

2218-
GROUP_GRAPHS = NO
2218+
GROUP_GRAPHS = YES
22192219

22202220
# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
22212221
# collaboration diagrams in a style similar to the OMG's Unified Modeling
22222222
# Language.
22232223
# The default value is: NO.
22242224
# This tag requires that the tag HAVE_DOT is set to YES.
22252225

2226-
UML_LOOK = NO
2226+
UML_LOOK = YES
22272227

22282228
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
22292229
# class node. If there are many fields or methods and many nodes the graph may
@@ -2236,15 +2236,15 @@ UML_LOOK = NO
22362236
# Minimum value: 0, maximum value: 100, default value: 10.
22372237
# This tag requires that the tag HAVE_DOT is set to YES.
22382238

2239-
UML_LIMIT_NUM_FIELDS = 10
2239+
UML_LIMIT_NUM_FIELDS = 6
22402240

22412241
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
22422242
# collaboration graphs will show the relations between templates and their
22432243
# instances.
22442244
# The default value is: NO.
22452245
# This tag requires that the tag HAVE_DOT is set to YES.
22462246

2247-
TEMPLATE_RELATIONS = NO
2247+
TEMPLATE_RELATIONS = YES
22482248

22492249
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
22502250
# YES then doxygen will generate a graph for each documented file showing the
@@ -2293,7 +2293,7 @@ CALLER_GRAPH = NO
22932293
# The default value is: YES.
22942294
# This tag requires that the tag HAVE_DOT is set to YES.
22952295

2296-
GRAPHICAL_HIERARCHY = NO
2296+
GRAPHICAL_HIERARCHY = YES
22972297

22982298
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
22992299
# dependencies a directory has on other directories in a graphical way. The
@@ -2329,7 +2329,7 @@ DOT_IMAGE_FORMAT = svg
23292329
# The default value is: NO.
23302330
# This tag requires that the tag HAVE_DOT is set to YES.
23312331

2332-
INTERACTIVE_SVG = NO
2332+
INTERACTIVE_SVG = YES
23332333

23342334
# The DOT_PATH tag can be used to specify the path where the dot tool can be
23352335
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -2379,7 +2379,7 @@ PLANTUML_INCLUDE_PATH =
23792379
# Minimum value: 0, maximum value: 10000, default value: 50.
23802380
# This tag requires that the tag HAVE_DOT is set to YES.
23812381

2382-
DOT_GRAPH_MAX_NODES = 15
2382+
DOT_GRAPH_MAX_NODES = 100
23832383

23842384
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
23852385
# generated by dot. A depth value of 3 means that only nodes reachable from the
@@ -2391,7 +2391,7 @@ DOT_GRAPH_MAX_NODES = 15
23912391
# Minimum value: 0, maximum value: 1000, default value: 0.
23922392
# This tag requires that the tag HAVE_DOT is set to YES.
23932393

2394-
MAX_DOT_GRAPH_DEPTH = 3
2394+
MAX_DOT_GRAPH_DEPTH = 50
23952395

23962396
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
23972397
# background. This is disabled by default, because dot on Windows does not seem

include/hal/I2C.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ class I2C : public Periph<i2c_info_t, i2c_attr_t, 'i'> {
199199
int get_error() const;
200200

201201
//deprecated
202+
#if !defined __link
203+
[[deprecated("use get_error()")]]
204+
#endif
202205
int get_err() const { return get_error(); }
203206

204207
/*! \details Sets the attributes of the I2C bus.

include/sys/File.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,13 @@ class File : public api::SObject {
305305
/*! \details Seeks to a location in the file or on the device. */
306306
virtual int seek(int loc, int whence = LINK_SEEK_SET) const;
307307

308-
309-
/*! \details Reads up to n-1 bytes to \a s until end-of-file or \a term is reached. */
310-
char * gets(char * s, int n, char term = '\n') const;
308+
/*! \details Reads a line in to the var::String until end-of-file or \a term is reached. */
309+
char * gets(var::String & s, char term = '\n') const;
311310

312311
#ifndef __link
313-
/*! \details Reads a line in to the var::String until end-of-file or \a term is reached. */
314-
char * gets(var::String & s, char term = '\n') const { return gets(s.cdata(), s.capacity(), term); }
312+
[[deprecated("Use gets(var::String & s) instead")]]
315313
#endif
316-
314+
char * gets(char * s, int n, char term = '\n') const;
317315

318316
#ifdef __link
319317
void set_driver(link_transport_mdriver_t * d){ m_driver = d; }

include/ui/EventLoop.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class EventLoop: public ev::EventLoop {
7272
/*! \details Updates the drawing attributes. */
7373
void set_drawing_attr(const draw::DrawingAttr & attr){ m_drawing_attr = attr; }
7474

75+
virtual Element * catch_null_handler(Element * last_element){ return 0; }
76+
77+
7578
static Element * handle_event(Element * current_element, const Event & event, const draw::DrawingAttr & drawing_attr, EventLoop * event_loop = 0);
7679
static void handle_transition(Element * current_element, Element * next_element, const draw::DrawingAttr & drawing_attr);
7780

include/var/String.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,17 @@ class String : public Data {
275275
bool empty() const { return size() == 0; }
276276

277277
/*! \details Assigns a substring of \a a to string. */
278-
void assign(const char * a, u32 subpos, u32 sublen){ assign(a + subpos, sublen); }
278+
int assign(const char * a, u32 subpos, u32 sublen){ return assign(a + subpos, sublen); }
279279
/*! \details Assigns a maximum of \a n characters of \a a to string. */
280-
void assign(const char * a, u32 n);
280+
int assign(const char * a, u32 n);
281281
/*! \details Assigns \a a (zero terminated) to string. */
282-
void assign(const char * a);
282+
int assign(const char * a);
283283
/*! \details Appends \a a (zero terminated) to string. */
284-
void append(const char * a);
284+
int append(const char * a);
285285
/*! \details Appends \a c to string. */
286-
void append(char c);
286+
int append(char c);
287287
/*! \details Appends \a c to string. */
288-
void push_back(char c) { append(c); }
288+
void push_back(char c){ append(c); }
289289

290290
/*! \details Copies the \a nth element (separated by \a sep) of the string to to \a dest. */
291291
bool get_delimited_data(String & dest, int n, char sep = ',', char term = '\n');

src/api/SObject.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <cstdio>
66
#include <cstdlib>
7+
#include <sos/link.h>
78

89
#include "api/SObject.hpp"
910

src/sys/File.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int File::close(){
173173

174174
int File::read(void * buf, int nbyte) const {
175175
#if defined __link
176-
return set_error_number_if_error( link_read(driver(), m_fd, buf, nbyte) );s
176+
return set_error_number_if_error( link_read(driver(), m_fd, buf, nbyte) );
177177
#else
178178
return set_error_number_if_error( ::read(m_fd, buf, nbyte) );
179179
#endif
@@ -253,6 +253,19 @@ char * File::gets(char * s, int n, char term) const {
253253

254254
}
255255

256+
char * File::gets(var::String & s, char term) const {
257+
int ret;
258+
char c;
259+
do {
260+
ret = read(&c, 1);
261+
if( ret > 0 ){
262+
s.append(c);
263+
}
264+
} while( (c != term) && (ret > 0) );
265+
return s.cdata();
266+
}
267+
268+
256269
const char * File::name(const char * path){
257270
int len;
258271
int i;

src/ui/EventLoop.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ bool EventLoop::handle_event(const Event & event){
6060
Element * tmp = current_element();
6161
tmp = handle_event(current_element(), event, drawing_attr(), this);
6262
if( tmp != current_element() ){
63+
if( tmp == 0 ){
64+
tmp = catch_null_handler(current_element());
65+
if( tmp != 0 ){
66+
tmp->set_event_loop(this);
67+
handle_transition(current_element(), tmp, drawing_attr());
68+
}
69+
}
6370
set_current_element(tmp);
6471
return true;
6572
}

src/var/String.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,47 +77,51 @@ char String::at(u32 pos) const {
7777
return 0;
7878
}
7979

80-
void String::assign(const char * a){
80+
int String::assign(const char * a){
8181
if( a == 0 ){
8282
clear();
83-
return;
83+
return 0;
8484
}
8585
u32 len = strlen(a);
86-
assign(a, len);
86+
return assign(a, len);
8787
}
8888

89-
void String::assign(const char * a, u32 n){
89+
int String::assign(const char * a, u32 n){
9090
if( a != 0 ){
91-
9291
if( n == (u32)npos ){
9392
n = strlen(a);
9493
}
95-
set_capacity(n+1); //attempt to resize the object to at least n
94+
if( set_capacity(n+1) < 0 ){
95+
return -1;
96+
}
9697
clear();
9798
strncpy(cdata(), a, n);
9899
} else {
99100
clear();
100101
}
102+
return 0;
101103
}
102104

103-
void String::append(const char * a){
104-
if( a == 0 ){ return; }
105+
int String::append(const char * a){
106+
if( a == 0 ){ return 0; }
105107
u32 len = size();
106108
u32 alen = strlen(a);
107109
set_capacity(len + alen); //try to make min capacity
108110
if( len == 0 ){
109111
clear(); //previous length was zero -- ensure string is valid
110112
}
111-
if( cdata() == 0 ){ return; }
113+
if( cdata() == 0 ){ return -1; }
112114
strncat(cdata(), a, capacity() - len);
115+
return 0;
113116
}
114117

115-
void String::append(char c){
118+
int String::append(char c){
116119
u32 len = size();
117120
u32 alen = 1;
118121
set_capacity(len + alen + 1); //try to make min capacity
119-
if( cdata() == 0 ){ return; }
122+
if( cdata() == 0 ){ return -1; }
120123
strncat(cdata(),&c,1);
124+
return 0;
121125
}
122126

123127
bool String::get_delimited_data(String & dest, int n, char sep, char term){

0 commit comments

Comments
 (0)