Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
2b4dc97c
Commit
2b4dc97c
authored
May 20, 2012
by
Davis King
Browse files
All I did in this change was rename a bunch of reinterpret_casts
to static_casts whenever it was possilbe to do so.
parent
5a166a6d
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
82 additions
and
82 deletions
+82
-82
dlib/binary_search_tree/binary_search_tree_kernel_c.h
dlib/binary_search_tree/binary_search_tree_kernel_c.h
+5
-5
dlib/cmd_line_parser/cmd_line_parser_kernel_1.h
dlib/cmd_line_parser/cmd_line_parser_kernel_1.h
+9
-9
dlib/config_reader/config_reader_kernel_1.h
dlib/config_reader/config_reader_kernel_1.h
+2
-2
dlib/config_reader/config_reader_thread_safe_1.h
dlib/config_reader/config_reader_thread_safe_1.h
+3
-3
dlib/gui_core/gui_core_kernel_1.cpp
dlib/gui_core/gui_core_kernel_1.cpp
+1
-1
dlib/gui_widgets/drawable.cpp
dlib/gui_widgets/drawable.cpp
+1
-1
dlib/gui_widgets/widgets.cpp
dlib/gui_widgets/widgets.cpp
+1
-1
dlib/hash_map/hash_map_kernel_c.h
dlib/hash_map/hash_map_kernel_c.h
+13
-13
dlib/hash_set/hash_set_kernel_c.h
dlib/hash_set/hash_set_kernel_c.h
+1
-1
dlib/hash_table/hash_table_kernel_c.h
dlib/hash_table/hash_table_kernel_c.h
+5
-5
dlib/linker/linker_kernel_1.cpp
dlib/linker/linker_kernel_1.cpp
+1
-1
dlib/map/map_kernel_c.h
dlib/map/map_kernel_c.h
+13
-13
dlib/memory_manager/memory_manager_kernel_1.h
dlib/memory_manager/memory_manager_kernel_1.h
+6
-6
dlib/memory_manager/memory_manager_kernel_2.h
dlib/memory_manager/memory_manager_kernel_2.h
+6
-6
dlib/memory_manager/memory_manager_kernel_3.h
dlib/memory_manager/memory_manager_kernel_3.h
+8
-8
dlib/server/server_kernel_1.h
dlib/server/server_kernel_1.h
+1
-1
dlib/set/set_kernel_c.h
dlib/set/set_kernel_c.h
+1
-1
dlib/test/pipe.cpp
dlib/test/pipe.cpp
+3
-3
dlib/test/sockstreambuf.cpp
dlib/test/sockstreambuf.cpp
+1
-1
dlib/threads/create_new_thread_extension.h
dlib/threads/create_new_thread_extension.h
+1
-1
No files found.
dlib/binary_search_tree/binary_search_tree_kernel_c.h
View file @
2b4dc97c
...
...
@@ -86,7 +86,7 @@ namespace dlib
range
&
r
)
{
DLIB_CASSERT
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
),
DLIB_CASSERT
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
),
"
\t
void binary_search_tree::add"
<<
"
\n\t
you can't call add() and give the same object to both parameters."
<<
"
\n\t
this: "
<<
this
...
...
@@ -131,9 +131,9 @@ namespace dlib
)
{
DLIB_CASSERT
(
this
->
operator
[](
d
)
!=
0
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
r
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
)),
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
d_copy
))
&&
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
))
&&
(
static
_cast
<
const
void
*>
(
&
r
)
!=
static
_cast
<
void
*>
(
&
d_copy
)),
"
\t
void binary_search_tree::remove"
<<
"
\n\t
the element must be in the tree for it to be removed"
<<
"
\n\t
this: "
<<
this
...
...
@@ -157,7 +157,7 @@ namespace dlib
)
{
DLIB_CASSERT
(
this
->
size
()
!=
0
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
)),
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
)),
"
\t
void binary_search_tree::remove_any"
<<
"
\n\t
tree must not be empty if something is going to be removed"
<<
"
\n\t
this: "
<<
this
...
...
dlib/cmd_line_parser/cmd_line_parser_kernel_1.h
View file @
2b4dc97c
...
...
@@ -284,10 +284,10 @@ namespace dlib
)
const
{
return
options
.
current_element_valid
();
}
const
cmd_line_parser_option
<
charT
>&
element
(
)
const
{
return
*
reinterpret
_cast
<
cmd_line_parser_option
<
charT
>*>
(
options
.
element
().
value
());
}
)
const
{
return
*
static
_cast
<
cmd_line_parser_option
<
charT
>*>
(
options
.
element
().
value
());
}
cmd_line_parser_option
<
charT
>&
element
(
)
{
return
*
reinterpret
_cast
<
cmd_line_parser_option
<
charT
>*>
(
options
.
element
().
value
());
}
)
{
return
*
static
_cast
<
cmd_line_parser_option
<
charT
>*>
(
options
.
element
().
value
());
}
bool
move_next
(
)
const
{
return
options
.
move_next
();
}
...
...
@@ -356,7 +356,7 @@ namespace dlib
options
.
reset
();
while
(
options
.
move_next
())
{
delete
reinterpret
_cast
<
option_t
*>
(
options
.
element
().
value
());
delete
static
_cast
<
option_t
*>
(
options
.
element
().
value
());
}
}
...
...
@@ -380,7 +380,7 @@ namespace dlib
options
.
reset
();
while
(
options
.
move_next
())
{
delete
reinterpret
_cast
<
option_t
*>
(
options
.
element
().
value
());
delete
static
_cast
<
option_t
*>
(
options
.
element
().
value
());
}
options
.
clear
();
reset
();
...
...
@@ -413,7 +413,7 @@ namespace dlib
options
.
reset
();
while
(
options
.
move_next
())
{
reinterpret
_cast
<
option_t
*>
(
options
.
element
().
value
())
->
clear
();
static
_cast
<
option_t
*>
(
options
.
element
().
value
())
->
clear
();
}
options
.
reset
();
}
...
...
@@ -469,7 +469,7 @@ namespace dlib
}
option_t
*
o
=
reinterpret
_cast
<
option_t
*>
(
options
[
temp
]);
option_t
*
o
=
static
_cast
<
option_t
*>
(
options
[
temp
]);
// check the number of arguments after this option and make sure
// it is correct
...
...
@@ -560,7 +560,7 @@ namespace dlib
throw
cmd_line_parse_error
(
EINVALID_OPTION
,
name
);
}
option_t
*
o
=
reinterpret
_cast
<
option_t
*>
(
options
[
name
]);
option_t
*
o
=
static
_cast
<
option_t
*>
(
options
[
name
]);
// if there are chars immediately following this option
int
delta
=
0
;
...
...
@@ -629,7 +629,7 @@ namespace dlib
options
.
reset
();
while
(
options
.
move_next
())
{
reinterpret
_cast
<
option_t
*>
(
options
.
element
().
value
())
->
clear
();
static
_cast
<
option_t
*>
(
options
.
element
().
value
())
->
clear
();
}
options
.
reset
();
...
...
@@ -708,7 +708,7 @@ namespace dlib
const
string_type
&
name
)
const
{
return
*
reinterpret
_cast
<
cmd_line_parser_option
<
charT
>*>
(
options
[
name
]);
return
*
static
_cast
<
cmd_line_parser_option
<
charT
>*>
(
options
[
name
]);
}
// ----------------------------------------------------------------------------------------
...
...
dlib/config_reader/config_reader_kernel_1.h
View file @
2b4dc97c
...
...
@@ -263,7 +263,7 @@ namespace dlib
block_table
.
reset
();
while
(
block_table
.
move_next
())
{
delete
reinterpret
_cast
<
config_reader_kernel_1
*>
(
block_table
.
element
().
value
());
delete
static
_cast
<
config_reader_kernel_1
*>
(
block_table
.
element
().
value
());
}
block_table
.
clear
();
key_table
.
clear
();
...
...
@@ -565,7 +565,7 @@ namespace dlib
throw
config_reader_access_error
(
name
,
""
);
}
return
*
reinterpret
_cast
<
config_reader_kernel_1
*>
(
block_table
[
name
]);
return
*
static
_cast
<
config_reader_kernel_1
*>
(
block_table
[
name
]);
}
// ----------------------------------------------------------------------------------------
...
...
dlib/config_reader/config_reader_thread_safe_1.h
View file @
2b4dc97c
...
...
@@ -293,7 +293,7 @@ namespace dlib
block_table
.
reset
();
while
(
block_table
.
move_next
())
{
delete
reinterpret
_cast
<
config_reader_thread_safe_1
*>
(
block_table
.
element
().
value
());
delete
static
_cast
<
config_reader_thread_safe_1
*>
(
block_table
.
element
().
value
());
}
block_table
.
clear
();
}
...
...
@@ -345,7 +345,7 @@ namespace dlib
throw
config_reader_access_error
(
name
,
""
);
}
return
*
reinterpret
_cast
<
config_reader_thread_safe_1
*>
(
block_table
[
name
]);
return
*
static
_cast
<
config_reader_thread_safe_1
*>
(
block_table
[
name
]);
}
// ----------------------------------------------------------------------------------------
...
...
@@ -431,7 +431,7 @@ namespace dlib
block_table
.
reset
();
while
(
block_table
.
move_next
())
{
delete
reinterpret
_cast
<
config_reader_thread_safe_1
*>
(
block_table
.
element
().
value
());
delete
static
_cast
<
config_reader_thread_safe_1
*>
(
block_table
.
element
().
value
());
}
block_table
.
clear
();
...
...
dlib/gui_core/gui_core_kernel_1.cpp
View file @
2b4dc97c
...
...
@@ -305,7 +305,7 @@ namespace dlib
static
void
error_box_helper
(
void
*
param
)
{
ebh_param
&
p
=
*
reinterpret
_cast
<
ebh_param
*>
(
param
);
ebh_param
&
p
=
*
static
_cast
<
ebh_param
*>
(
param
);
#ifdef UNICODE
MessageBox
(
NULL
,
convert_mbstring_to_wstring
(
p
.
text
).
c_str
(),
convert_mbstring_to_wstring
(
p
.
title
).
c_str
(),
MB_OK
|
MB_ICONERROR
|
MB_SYSTEMMODAL
...
...
dlib/gui_widgets/drawable.cpp
View file @
2b4dc97c
...
...
@@ -80,7 +80,7 @@ namespace dlib
int
i
)
{
drawable
*
d
=
reinterpret
_cast
<
drawable
*>
(
p
);
drawable
*
d
=
static
_cast
<
drawable
*>
(
p
);
if
(
widget_set
.
is_member
(
d
))
{
d
->
on_user_event
(
i
);
...
...
dlib/gui_widgets/widgets.cpp
View file @
2b4dc97c
...
...
@@ -2695,7 +2695,7 @@ namespace dlib
// The point of this extra event_handler stuff is to allow the user
// to end the program from within the callback. So we want to destroy the
// window *before* we call their callback.
box_win
&
w
=
*
reinterpret
_cast
<
box_win
*>
(
param
);
box_win
&
w
=
*
static
_cast
<
box_win
*>
(
param
);
w
.
close_window
();
any_function
<
void
()
>
event_handler
(
w
.
event_handler
);
delete
&
w
;
...
...
dlib/hash_map/hash_map_kernel_c.h
View file @
2b4dc97c
...
...
@@ -82,14 +82,14 @@ namespace dlib
// make sure requires clause is not broken
DLIB_CASSERT
(
(
!
this
->
is_in_domain
(
d
))
&&
(
reinterpret
_cast
<
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
)),
(
static
_cast
<
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
)),
"
\t
void hash_map::add"
<<
"
\n\t
domain element being added must not already be in the hash_map"
<<
"
\n\t
and d and r must not be the same variable"
<<
"
\n\t
is_in_domain(d): "
<<
(
this
->
is_in_domain
(
d
)
?
"true"
:
"false"
)
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
reinterpret
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d: "
<<
static
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
static
_cast
<
void
*>
(
&
r
)
);
...
...
@@ -112,14 +112,14 @@ namespace dlib
// make sure requires clause is not broken
DLIB_CASSERT
(
(
this
->
size
()
>
0
)
&&
(
reinterpret
_cast
<
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
)),
(
static
_cast
<
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
)),
"
\t
void hash_map::remove_any"
<<
"
\n\t
size() must be greater than zero if something is going to be removed"
<<
"
\n\t
and d and r must not be the same variable."
<<
"
\n\t
size(): "
<<
this
->
size
()
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
reinterpret
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d: "
<<
static
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
static
_cast
<
void
*>
(
&
r
)
);
...
...
@@ -143,17 +143,17 @@ namespace dlib
// make sure requires clause is not broken
DLIB_CASSERT
(
(
this
->
is_in_domain
(
d
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
))
&&
(
reinterpret
_cast
<
void
*>
(
&
r
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
)),
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
))
&&
(
static
_cast
<
void
*>
(
&
r
)
!=
static
_cast
<
void
*>
(
&
d_copy
))
&&
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
d_copy
)),
"
\t
void hash_map::remove"
<<
"
\n\t
can't remove something that isn't in the hash_map or if the paremeters"
<<
"
\n\t
are actually the same variable. Either way can't remove."
<<
"
\n\t
is_in_domain(d): "
<<
(
this
->
is_in_domain
(
d
)
?
"true"
:
"false"
)
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
const
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
reinterpret
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d_copy: "
<<
reinterpret
_cast
<
void
*>
(
&
d_copy
)
<<
"
\n\t
&d: "
<<
static
_cast
<
const
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
static
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d_copy: "
<<
static
_cast
<
void
*>
(
&
d_copy
)
);
...
...
@@ -178,7 +178,7 @@ namespace dlib
"
\t
void hash_map::destroy"
<<
"
\n\t
can't remove something that isn't in the hash_map"
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
const
void
*>
(
&
d
)
<<
"
\n\t
&d: "
<<
static
_cast
<
const
void
*>
(
&
d
)
);
...
...
dlib/hash_set/hash_set_kernel_c.h
View file @
2b4dc97c
...
...
@@ -91,7 +91,7 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_CASSERT
(
this
->
is_member
(
item
)
&&
(
reinterpret
_cast
<
const
void
*>
(
&
item
)
!=
reinterpret
_cast
<
void
*>
(
&
item_copy
)),
(
static
_cast
<
const
void
*>
(
&
item
)
!=
static
_cast
<
void
*>
(
&
item_copy
)),
"
\t
void hash_set::remove"
<<
"
\n\t
item should be in the hash_set if it's going to be removed"
<<
"
\n\t
this: "
<<
this
...
...
dlib/hash_table/hash_table_kernel_c.h
View file @
2b4dc97c
...
...
@@ -88,9 +88,9 @@ namespace dlib
)
{
DLIB_CASSERT
(
this
->
operator
[](
d
)
!=
0
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
r
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
)),
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
d_copy
))
&&
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
))
&&
(
static
_cast
<
const
void
*>
(
&
r
)
!=
static
_cast
<
void
*>
(
&
d_copy
)),
"
\t
void binary_search_tree::remove"
<<
"
\n\t
the element must be in the table for it to be removed"
<<
"
\n\t
this: "
<<
this
...
...
@@ -113,7 +113,7 @@ namespace dlib
range
&
r
)
{
DLIB_CASSERT
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
),
DLIB_CASSERT
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
),
"
\t
void binary_search_tree::add"
<<
"
\n\t
you can't call add() and give the same object to both arguments."
<<
"
\n\t
this: "
<<
this
...
...
@@ -157,7 +157,7 @@ namespace dlib
)
{
DLIB_CASSERT
(
this
->
size
()
!=
0
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
)),
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
)),
"
\t
void hash_table::remove_any"
<<
"
\n\t
table must not be empty if something is going to be removed"
<<
"
\n\t
this: "
<<
this
...
...
dlib/linker/linker_kernel_1.cpp
View file @
2b4dc97c
...
...
@@ -238,7 +238,7 @@ namespace dlib
void
*
param
)
{
linker_kernel_1
&
p
=
*
reinterpret
_cast
<
linker_kernel_1
*>
(
param
);
linker_kernel_1
&
p
=
*
static
_cast
<
linker_kernel_1
*>
(
param
);
p
.
cons_mutex
.
lock
();
// if the connections are gone for whatever reason then return
...
...
dlib/map/map_kernel_c.h
View file @
2b4dc97c
...
...
@@ -82,14 +82,14 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_CASSERT
(
(
!
this
->
is_in_domain
(
d
))
&&
(
reinterpret
_cast
<
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
)),
(
static
_cast
<
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
)),
"
\t
void map::add"
<<
"
\n\t
domain element being added must not already be in the map"
<<
"
\n\t
and d and r must not be the same variable"
<<
"
\n\t
is_in_domain(d): "
<<
(
this
->
is_in_domain
(
d
)
?
"true"
:
"false"
)
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
reinterpret
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d: "
<<
static
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
static
_cast
<
void
*>
(
&
r
)
);
// call the real function
...
...
@@ -109,14 +109,14 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_CASSERT
(
(
this
->
size
()
>
0
)
&&
(
reinterpret
_cast
<
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
)),
(
static
_cast
<
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
)),
"
\t
void map::remove_any"
<<
"
\n\t
size() must be greater than zero if something is going to be removed"
<<
"
\n\t
and d and r must not be the same variable."
<<
"
\n\t
size(): "
<<
this
->
size
()
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
reinterpret
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d: "
<<
static
_cast
<
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
static
_cast
<
void
*>
(
&
r
)
);
// call the real function
...
...
@@ -137,17 +137,17 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_CASSERT
(
(
this
->
is_in_domain
(
d
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
r
))
&&
(
reinterpret
_cast
<
void
*>
(
&
r
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
))
&&
(
reinterpret
_cast
<
const
void
*>
(
&
d
)
!=
reinterpret
_cast
<
void
*>
(
&
d_copy
)),
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
r
))
&&
(
static
_cast
<
void
*>
(
&
r
)
!=
static
_cast
<
void
*>
(
&
d_copy
))
&&
(
static
_cast
<
const
void
*>
(
&
d
)
!=
static
_cast
<
void
*>
(
&
d_copy
)),
"
\t
void map::remove"
<<
"
\n\t
can't remove something that isn't in the map or if the paremeters actually"
<<
"
\n\t
are the same variable. Either way can't remove."
<<
"
\n\t
is_in_domain(d): "
<<
(
this
->
is_in_domain
(
d
)
?
"true"
:
"false"
)
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
const
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
reinterpret
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d_copy: "
<<
reinterpret
_cast
<
void
*>
(
&
d_copy
)
<<
"
\n\t
&d: "
<<
static
_cast
<
const
void
*>
(
&
d
)
<<
"
\n\t
&r: "
<<
static
_cast
<
void
*>
(
&
r
)
<<
"
\n\t
&d_copy: "
<<
static
_cast
<
void
*>
(
&
d_copy
)
);
// call the real function
...
...
@@ -169,7 +169,7 @@ namespace dlib
"
\t
void map::destroy"
<<
"
\n\t
can't remove something that isn't in the map"
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
&d: "
<<
reinterpret
_cast
<
const
void
*>
(
&
d
)
<<
"
\n\t
&d: "
<<
static
_cast
<
const
void
*>
(
&
d
)
);
// call the real function
...
...
dlib/memory_manager/memory_manager_kernel_1.h
View file @
2b4dc97c
...
...
@@ -82,7 +82,7 @@ namespace dlib
{
node
*
temp
=
next
;
next
=
next
->
next
;
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
temp
));
::
operator
delete
(
static
_cast
<
void
*>
(
temp
));
}
}
...
...
@@ -119,7 +119,7 @@ namespace dlib
try
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
temp
))
T
();
new
(
static
_cast
<
void
*>
(
temp
))
T
();
}
catch
(...)
{
...
...
@@ -133,16 +133,16 @@ namespace dlib
}
else
{
temp
=
reinterpret
_cast
<
T
*>
(
::
operator
new
(
sizeof
(
node
)));
temp
=
static
_cast
<
T
*>
(
::
operator
new
(
sizeof
(
node
)));
try
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
temp
))
T
();
new
(
static
_cast
<
void
*>
(
temp
))
T
();
}
catch
(...)
{
// construction of the new object threw so delete the block of memory
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
temp
));
::
operator
delete
(
static
_cast
<
void
*>
(
temp
));
throw
;
}
}
...
...
@@ -160,7 +160,7 @@ namespace dlib
if
(
pool_size
>=
max_pool_size
)
{
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
item
));
::
operator
delete
(
static
_cast
<
void
*>
(
item
));
return
;
}
...
...
dlib/memory_manager/memory_manager_kernel_2.h
View file @
2b4dc97c
...
...
@@ -96,7 +96,7 @@ namespace dlib
chunk_node
*
temp
=
first_chunk
;
first_chunk
=
first_chunk
->
next
;
// delete the memory chunk
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
temp
->
chunk
));
::
operator
delete
(
static
_cast
<
void
*>
(
temp
->
chunk
));
// delete the chunk_node
delete
temp
;
}
...
...
@@ -135,7 +135,7 @@ namespace dlib
try
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
temp
))
T
();
new
(
static
_cast
<
void
*>
(
temp
))
T
();
}
catch
(...)
{
...
...
@@ -149,7 +149,7 @@ namespace dlib
{
// the linked list is empty so we need to allocate some more memory
node
*
block
=
0
;
block
=
reinterpret
_cast
<
node
*>
(
::
operator
new
(
sizeof
(
node
)
*
chunk_size
));
block
=
static
_cast
<
node
*>
(
::
operator
new
(
sizeof
(
node
)
*
chunk_size
));
// the first part of this block can be our new object
temp
=
reinterpret_cast
<
T
*>
(
block
);
...
...
@@ -157,12 +157,12 @@ namespace dlib
try
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
temp
))
T
();
new
(
static
_cast
<
void
*>
(
temp
))
T
();
}
catch
(...)
{
// construction of the new object threw so delete the block of memory
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
block
));
::
operator
delete
(
static
_cast
<
void
*>
(
block
));
throw
;
}
...
...
@@ -172,7 +172,7 @@ namespace dlib
catch
(...)
{
temp
->~
T
();
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
block
));
::
operator
delete
(
static
_cast
<
void
*>
(
block
));
throw
;
}
...
...
dlib/memory_manager/memory_manager_kernel_3.h
View file @
2b4dc97c
...
...
@@ -109,7 +109,7 @@ namespace dlib
chunk_node
*
temp
=
first_chunk
;
first_chunk
=
first_chunk
->
next
;
// delete the memory chunk
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
temp
->
chunk
));
::
operator
delete
(
static
_cast
<
void
*>
(
temp
->
chunk
));
// delete the chunk_node
delete
temp
;
}
...
...
@@ -152,7 +152,7 @@ namespace dlib
}
else
{
temp
=
reinterpret
_cast
<
char
*>
(
::
operator
new
(
block_size
));
temp
=
static
_cast
<
char
*>
(
::
operator
new
(
block_size
));
}
reinterpret_cast
<
size_t
*>
(
temp
)[
0
]
=
block_size
;
...
...
@@ -204,7 +204,7 @@ namespace dlib
try
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
temp
))
T
();
new
(
static
_cast
<
void
*>
(
temp
))
T
();
}
catch
(...)
{
...
...
@@ -217,7 +217,7 @@ namespace dlib
else
{
// the linked list is empty so we need to allocate some more memory
node
*
block
=
reinterpret
_cast
<
node
*>
(
::
operator
new
(
sizeof
(
node
)
*
chunk_size
));
node
*
block
=
static
_cast
<
node
*>
(
::
operator
new
(
sizeof
(
node
)
*
chunk_size
));
// the first part of this block can be our new object
temp
=
reinterpret_cast
<
T
*>
(
block
);
...
...
@@ -225,12 +225,12 @@ namespace dlib
try
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
temp
))
T
();
new
(
static
_cast
<
void
*>
(
temp
))
T
();
}
catch
(...)
{
// construction of the new object threw so delete the block of memory
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
block
));
::
operator
delete
(
static
_cast
<
void
*>
(
block
));
throw
;
}
...
...
@@ -240,7 +240,7 @@ namespace dlib
catch
(...)
{
temp
->~
T
();
::
operator
delete
(
reinterpret
_cast
<
void
*>
(
block
));
::
operator
delete
(
static
_cast
<
void
*>
(
block
));
throw
;
}
...
...
@@ -310,7 +310,7 @@ namespace dlib
for
(
i
=
0
;
i
<
size
;
++
i
)
{
// construct this new T object with placement new.
new
(
reinterpret
_cast
<
void
*>
(
array
+
i
))
T
();
new
(
static
_cast
<
void
*>
(
array
+
i
))
T
();
}
}
catch
(...)
...
...
dlib/server/server_kernel_1.h
View file @
2b4dc97c
...
...
@@ -661,7 +661,7 @@ namespace dlib
void
*
item
)
{
param
&
p
=
*
reinterpret
_cast
<
param
*>
(
item
);
param
&
p
=
*
static
_cast
<
param
*>
(
item
);
p
.
server
.
on_connect
(
p
.
new_connection
);
...
...
dlib/set/set_kernel_c.h
View file @
2b4dc97c
...
...
@@ -89,7 +89,7 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_CASSERT
(
this
->
is_member
(
item
)
&&
(
reinterpret
_cast
<
const
void
*>
(
&
item
)
!=
reinterpret
_cast
<
void
*>
(
&
item_copy
)),
(
static
_cast
<
const
void
*>
(
&
item
)
!=
static
_cast
<
void
*>
(
&
item_copy
)),
"
\t
void set::remove"
<<
"
\n\t
item should be in the set if it's going to be removed"
<<
"
\n\t
this: "
<<
this
...
...
dlib/test/pipe.cpp
View file @
2b4dc97c
...
...
@@ -58,7 +58,7 @@ namespace
)
{
add_running_thread
();
pipe
&
p
=
*
reinterpret
_cast
<
pipe
*>
(
param
);
pipe
&
p
=
*
static
_cast
<
pipe
*>
(
param
);
try
{
...
...
@@ -95,7 +95,7 @@ namespace
)
{
add_running_thread
();
pipe
&
p
=
*
reinterpret
_cast
<
pipe
*>
(
param
);
pipe
&
p
=
*
static
_cast
<
pipe
*>
(
param
);
try
{
...
...
@@ -131,7 +131,7 @@ namespace
)
{
add_running_thread
();
pipe
&
p
=
*
reinterpret
_cast
<
pipe
*>
(
param
);
pipe
&
p
=
*
static
_cast
<
pipe
*>
(
param
);
try
{
...
...
dlib/test/sockstreambuf.cpp
View file @
2b4dc97c
...
...
@@ -37,7 +37,7 @@ namespace
)
{
listener
&
list
=
*
reinterpret
_cast
<
listener
*>
(
param
);
listener
&
list
=
*
static
_cast
<
listener
*>
(
param
);
connection
*
con
;
list
.
accept
(
con
);
...
...
dlib/threads/create_new_thread_extension.h
View file @
2b4dc97c
...
...
@@ -20,7 +20,7 @@ namespace dlib
void
*
obj
)
{
T
*
o
=
reinterpret
_cast
<
T
*>
(
obj
);
T
*
o
=
static
_cast
<
T
*>
(
obj
);
(
o
->*
funct
)();
}
...
...
Prev
1
2
Next
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