Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
869ff348
Commit
869ff348
authored
Oct 21, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added clearer range checks for string class to help compiler
parent
963d7c52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
qcstring.h
qtools/qcstring.h
+4
-4
No files found.
qtools/qcstring.h
View file @
869ff348
...
...
@@ -431,7 +431,7 @@ public:
StringRep
(
int
size
)
{
u
.
s
.
isShort
=
size
<=
SHORT_STR_CAPACITY
;
if
(
u
.
s
.
isShort
)
// init short string
if
(
size
<=
SHORT_STR_CAPACITY
)
// init short string
{
if
(
size
>
0
)
{
...
...
@@ -453,8 +453,8 @@ public:
if
(
str
)
{
int
len
=
strlen
(
str
);
u
.
s
.
isShort
=
len
<
=
SHORT_STR_MAX_LEN
;
if
(
u
.
s
.
isShort
)
u
.
s
.
isShort
=
len
<
SHORT_STR_CAPACITY
;
if
(
len
<
SHORT_STR_CAPACITY
)
{
u
.
s
.
len
=
len
;
memcpy
(
u
.
s
.
str
,
str
,
len
+
1
);
...
...
@@ -527,7 +527,7 @@ public:
{
int
len
=
strlen
(
str
);
u
.
s
.
isShort
=
len
<=
SHORT_STR_MAX_LEN
;
if
(
u
.
s
.
isShort
)
if
(
len
<
SHORT_STR_CAPACITY
)
{
u
.
s
.
len
=
len
;
memcpy
(
u
.
s
.
str
,
str
,
len
+
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment