Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
23547c0f
Commit
23547c0f
authored
Apr 02, 2010
by
Mikhail Maroukhine
Committed by
Alexandre Julliard
Apr 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Fix compiler warnings with flag -Wcast-qual.
parent
ca1b35aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
31 deletions
+29
-31
search.c
tools/winedump/search.c
+27
-28
symbol.c
tools/winedump/symbol.c
+1
-2
winedump.h
tools/winedump/winedump.h
+1
-1
No files found.
tools/winedump/search.c
View file @
23547c0f
...
@@ -242,34 +242,33 @@ static int symbol_from_prototype (parsed_symbol *sym, const char *proto)
...
@@ -242,34 +242,33 @@ static int symbol_from_prototype (parsed_symbol *sym, const char *proto)
static
const
char
*
get_type
(
parsed_symbol
*
sym
,
const
char
*
proto
,
int
arg
)
static
const
char
*
get_type
(
parsed_symbol
*
sym
,
const
char
*
proto
,
int
arg
)
{
{
int
is_const
,
is_volatile
,
is_struct
,
is_signed
,
is_unsigned
,
ptrs
=
0
;
int
is_const
,
is_volatile
,
is_struct
,
is_signed
,
is_unsigned
,
ptrs
=
0
;
const
char
*
iter
,
*
type_str
,
*
base_type
,
*
catch_unsigned
;
const
char
*
iter
,
*
base_type
,
*
catch_unsigned
,
*
proto_str
;
char
dest_type
,
*
type_str
_tmp
;
char
dest_type
,
*
type_str
;
assert
(
sym
&&
sym
->
symbol
);
assert
(
sym
&&
sym
->
symbol
);
assert
(
proto
&&
*
proto
);
assert
(
proto
&&
*
proto
);
assert
(
arg
<
0
||
(
unsigned
)
arg
==
sym
->
argc
);
assert
(
arg
<
0
||
(
unsigned
)
arg
==
sym
->
argc
);
type_str
=
proto
;
proto
=
str_match
(
proto
,
"const"
,
&
is_const
);
proto
_str
=
str_match
(
proto
,
"const"
,
&
is_const
);
proto
=
str_match
(
proto
,
"volatile"
,
&
is_volatile
);
proto
_str
=
str_match
(
proto_str
,
"volatile"
,
&
is_volatile
);
proto
=
str_match
(
proto
,
"struct"
,
&
is_struct
);
proto
_str
=
str_match
(
proto_str
,
"struct"
,
&
is_struct
);
if
(
!
is_struct
)
if
(
!
is_struct
)
proto
=
str_match
(
proto
,
"union"
,
&
is_struct
);
proto
_str
=
str_match
(
proto_str
,
"union"
,
&
is_struct
);
catch_unsigned
=
proto
;
catch_unsigned
=
proto
_str
;
proto
=
str_match
(
proto
,
"unsigned"
,
&
is_unsigned
);
proto
_str
=
str_match
(
proto_str
,
"unsigned"
,
&
is_unsigned
);
proto
=
str_match
(
proto
,
"signed"
,
&
is_signed
);
proto
_str
=
str_match
(
proto_str
,
"signed"
,
&
is_signed
);
/* Can have 'unsigned const' or 'const unsigned' etc */
/* Can have 'unsigned const' or 'const unsigned' etc */
if
(
!
is_const
)
if
(
!
is_const
)
proto
=
str_match
(
proto
,
"const"
,
&
is_const
);
proto
_str
=
str_match
(
proto_str
,
"const"
,
&
is_const
);
if
(
!
is_volatile
)
if
(
!
is_volatile
)
proto
=
str_match
(
proto
,
"volatile"
,
&
is_volatile
);
proto
_str
=
str_match
(
proto_str
,
"volatile"
,
&
is_volatile
);
base_type
=
proto
;
base_type
=
proto
_str
;
iter
=
str_find_set
(
proto
,
" ,*)"
);
iter
=
str_find_set
(
proto
_str
,
" ,*)"
);
if
(
!
iter
)
if
(
!
iter
)
return
NULL
;
return
NULL
;
...
@@ -279,7 +278,7 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
...
@@ -279,7 +278,7 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
if
(
strncmp
(
base_type
,
"int"
,
3
)
&&
strncmp
(
base_type
,
"long"
,
4
)
&&
if
(
strncmp
(
base_type
,
"int"
,
3
)
&&
strncmp
(
base_type
,
"long"
,
4
)
&&
strncmp
(
base_type
,
"short"
,
5
)
&&
strncmp
(
base_type
,
"char"
,
4
))
strncmp
(
base_type
,
"short"
,
5
)
&&
strncmp
(
base_type
,
"char"
,
4
))
{
{
iter
=
proto
;
iter
=
proto
_str
;
base_type
=
catch_unsigned
;
base_type
=
catch_unsigned
;
}
else
}
else
catch_unsigned
=
NULL
;
catch_unsigned
=
NULL
;
...
@@ -288,22 +287,22 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
...
@@ -288,22 +287,22 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
catch_unsigned
=
NULL
;
catch_unsigned
=
NULL
;
/* FIXME: skip const/volatile here too */
/* FIXME: skip const/volatile here too */
for
(
proto
=
iter
;
*
proto
;
proto
++
)
for
(
proto
_str
=
iter
;
*
proto_str
;
proto_str
++
)
if
(
*
proto
==
'*'
)
if
(
*
proto
_str
==
'*'
)
ptrs
++
;
ptrs
++
;
else
if
(
*
proto
!=
' '
)
else
if
(
*
proto
_str
!=
' '
)
break
;
break
;
if
(
!*
proto
)
if
(
!*
proto
_str
)
return
NULL
;
return
NULL
;
type_str
=
type_str_tmp
=
str_substring
(
type_str
,
proto
);
type_str
=
str_substring
(
proto
,
proto_str
);
if
(
iter
==
base_type
||
catch_unsigned
)
if
(
iter
==
base_type
||
catch_unsigned
)
{
{
/* 'unsigned' with no type */
/* 'unsigned' with no type */
char
*
tmp
=
str_create
(
2
,
type_str
,
" int"
);
char
*
tmp
=
str_create
(
2
,
type_str
,
" int"
);
free
(
type_str
_tmp
);
free
(
type_str
);
type_str
=
t
ype_str_tmp
=
t
mp
;
type_str
=
tmp
;
}
}
symbol_clean_string
(
type_str
);
symbol_clean_string
(
type_str
);
...
@@ -319,23 +318,23 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
...
@@ -319,23 +318,23 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
sym
->
arg_type
[
arg
]
=
dest_type
;
sym
->
arg_type
[
arg
]
=
dest_type
;
sym
->
arg_flag
[
arg
]
=
is_const
?
CT_CONST
:
is_volatile
?
CT_VOLATILE
:
0
;
sym
->
arg_flag
[
arg
]
=
is_const
?
CT_CONST
:
is_volatile
?
CT_VOLATILE
:
0
;
if
(
*
proto
==
','
||
*
proto
==
')'
)
if
(
*
proto
_str
==
','
||
*
proto_str
==
')'
)
sym
->
arg_name
[
arg
]
=
str_create_num
(
1
,
arg
,
"arg"
);
sym
->
arg_name
[
arg
]
=
str_create_num
(
1
,
arg
,
"arg"
);
else
else
{
{
iter
=
str_find_set
(
proto
,
" ,)"
);
iter
=
str_find_set
(
proto
_str
,
" ,)"
);
if
(
!
iter
)
if
(
!
iter
)
{
{
free
(
type_str
_tmp
);
free
(
type_str
);
return
NULL
;
return
NULL
;
}
}
sym
->
arg_name
[
arg
]
=
str_substring
(
proto
,
iter
);
sym
->
arg_name
[
arg
]
=
str_substring
(
proto
_str
,
iter
);
proto
=
iter
;
proto
_str
=
iter
;
}
}
sym
->
arg_text
[
arg
]
=
(
char
*
)
type_str
;
sym
->
arg_text
[
arg
]
=
(
char
*
)
type_str
;
}
}
return
proto
;
return
proto
_str
;
}
}
...
...
tools/winedump/symbol.c
View file @
23547c0f
...
@@ -287,10 +287,9 @@ int symbol_get_type (const char *string)
...
@@ -287,10 +287,9 @@ int symbol_get_type (const char *string)
*
*
* Make a type string more Wine-friendly. Logically const :-)
* Make a type string more Wine-friendly. Logically const :-)
*/
*/
void
symbol_clean_string
(
c
onst
char
*
string
)
void
symbol_clean_string
(
c
har
*
str
)
{
{
const
char
*
const
*
tab
=
swap_after
;
const
char
*
const
*
tab
=
swap_after
;
char
*
str
=
(
char
*
)
string
;
#define SWAP(i, p, x, y) do { i = p; while ((i = str_replace (i, x, y))); } while(0)
#define SWAP(i, p, x, y) do { i = p; while ((i = str_replace (i, x, y))); } while(0)
...
...
tools/winedump/winedump.h
View file @
23547c0f
...
@@ -176,7 +176,7 @@ const char *symbol_get_call_convention(const parsed_symbol *sym);
...
@@ -176,7 +176,7 @@ const char *symbol_get_call_convention(const parsed_symbol *sym);
const
char
*
symbol_get_spec_type
(
const
parsed_symbol
*
sym
,
size_t
arg
);
const
char
*
symbol_get_spec_type
(
const
parsed_symbol
*
sym
,
size_t
arg
);
void
symbol_clean_string
(
c
onst
c
har
*
string
);
void
symbol_clean_string
(
char
*
string
);
int
symbol_get_type
(
const
char
*
string
);
int
symbol_get_type
(
const
char
*
string
);
...
...
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