Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
6e335604
Commit
6e335604
authored
6 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Replace strStartsWith() and strcmp() by strIsEqual().
parent
3ce4c9ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cdf_util.c
+3
-3
3 additions, 3 deletions
src/cdf_util.c
src/cdi_int.h
+7
-0
7 additions, 0 deletions
src/cdi_int.h
src/stream_cdf_i.c
+75
-80
75 additions, 80 deletions
src/stream_cdf_i.c
with
85 additions
and
83 deletions
src/cdf_util.c
+
3
−
3
View file @
6e335604
...
...
@@ -19,10 +19,10 @@ char *strToLower(char *str)
bool
strStartsWith
(
const
char
*
vstr
,
const
char
*
cstr
)
{
bool
is_equal
=
false
;
if
(
vstr
&&
*
v
str
)
if
(
vstr
&&
c
str
)
{
size_t
clen
=
(
cstr
!=
NULL
)
?
strlen
(
cstr
)
:
0
;
size_t
vlen
=
(
vstr
!=
NULL
)
?
strlen
(
vstr
)
:
0
;
size_t
clen
=
strlen
(
cstr
);
size_t
vlen
=
strlen
(
vstr
);
if
(
clen
<=
vlen
)
is_equal
=
(
memcmp
(
vstr
,
cstr
,
clen
)
==
0
);
}
return
is_equal
;
...
...
This diff is collapsed.
Click to expand it.
src/cdi_int.h
+
7
−
0
View file @
6e335604
...
...
@@ -41,6 +41,13 @@ char *strdup(const char *s);
char
*
strToLower
(
char
*
str
);
bool
strStartsWith
(
const
char
*
vstr
,
const
char
*
cstr
);
inline
bool
strIsEqual
(
const
char
*
x
,
const
char
*
y
)
{
return
(
*
x
==
*
y
)
&&
strcmp
(
x
,
y
)
==
0
;
}
#ifndef M_PI
#define M_PI 3.14159265358979323846
/* pi */
#endif
...
...
This diff is collapsed.
Click to expand it.
src/stream_cdf_i.c
+
75
−
80
View file @
6e335604
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment