Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
0b802b31
Commit
0b802b31
authored
May 05, 2009
by
Oswald Buddenhagen
Browse files
less inefficient
still quite some potential ...
parent
0368b213
Changes
1
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/gdbmacros.cpp
View file @
0b802b31
...
...
@@ -221,16 +221,19 @@ Q_DECL_EXPORT char qDumpOutBuffer[100000];
namespace
{
static
QByteArray
strPtrConst
=
"* const"
;
static
bool
isPointerType
(
const
QByteArray
&
type
)
{
return
type
.
endsWith
(
"*"
)
||
type
.
endsWith
(
"* c
onst
"
);
return
type
.
endsWith
(
'*'
)
||
type
.
endsWith
(
strPtrC
onst
);
}
static
QByteArray
stripPointerType
(
QByteArray
type
)
static
QByteArray
stripPointerType
(
const
QByteArray
&
_
type
)
{
if
(
type
.
endsWith
(
"*"
))
QByteArray
type
=
_type
;
if
(
type
.
endsWith
(
'*'
))
type
.
chop
(
1
);
if
(
type
.
endsWith
(
"* c
onst
"
))
if
(
type
.
endsWith
(
strPtrC
onst
))
type
.
chop
(
7
);
if
(
type
.
endsWith
(
' '
))
type
.
chop
(
1
);
...
...
@@ -279,7 +282,10 @@ static bool isEqual(const char *s, const char *t)
static
bool
startsWith
(
const
char
*
s
,
const
char
*
t
)
{
return
qstrncmp
(
s
,
t
,
qstrlen
(
t
))
==
0
;
while
(
char
c
=
*
t
++
)
if
(
c
!=
*
s
++
)
return
false
;
return
true
;
}
// Check memory for read access and provoke segfault if nothing else helps.
...
...
@@ -293,11 +299,18 @@ static bool startsWith(const char *s, const char *t)
# define qCheckPointer(d) do { if (d) qProvokeSegFaultHelper = *(char*)d; } while (0)
#endif
#ifdef QT_NAMESPACE
const
char
*
stripNamespace
(
const
char
*
type
)
{
static
const
size_t
nslen
=
q
strlen
(
NS
);
static
const
size_t
nslen
=
strlen
(
NS
);
return
startsWith
(
type
,
NS
)
?
type
+
nslen
:
type
;
}
#else
inline
const
char
*
stripNamespace
(
const
char
*
type
)
{
return
type
;
}
#endif
static
bool
isSimpleType
(
const
char
*
type
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment