Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
eb676bf0
Commit
eb676bf0
authored
Nov 01, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just fixes compiler warnings in gcc 4.8 and clang 3.4.
parent
e9c6a774
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
18 additions
and
55 deletions
+18
-55
assert.h
dlib/assert.h
+14
-4
min_cut.h
dlib/graph_cuts/min_cut.h
+0
-4
edge_detector.h
dlib/image_transforms/edge_detector.h
+0
-1
equalize_histogram.h
dlib/image_transforms/equalize_histogram.h
+0
-1
segment_image.h
dlib/image_transforms/segment_image.h
+0
-1
matrix_assign.h
dlib/matrix/matrix_assign.h
+2
-7
matrix_la.h
dlib/matrix/matrix_la.h
+0
-7
optimization_trust_region.h
dlib/optimization/optimization_trust_region.h
+0
-2
svm.h
dlib/svm.h
+1
-1
cross_validate_multiclass_trainer.h
dlib/svm/cross_validate_multiclass_trainer.h
+0
-1
cross_validate_regression_trainer.h
dlib/svm/cross_validate_regression_trainer.h
+0
-2
feature_ranking.h
dlib/svm/feature_ranking.h
+0
-3
krr_trainer.h
dlib/svm/krr_trainer.h
+0
-1
pegasos.h
dlib/svm/pegasos.h
+0
-4
rbf_network.h
dlib/svm/rbf_network.h
+0
-1
sort_basis_vectors.h
dlib/svm/sort_basis_vectors.h
+0
-1
svm.h
dlib/svm/svm.h
+0
-3
svm_threaded.h
dlib/svm/svm_threaded.h
+0
-3
cmd_line_parser.h
dlib/test/cmd_line_parser.h
+0
-1
matrix2.cpp
dlib/test/matrix2.cpp
+0
-1
matrix3.cpp
dlib/test/matrix3.cpp
+0
-1
matrix4.cpp
dlib/test/matrix4.cpp
+0
-1
opt_qp_solver.cpp
dlib/test/opt_qp_solver.cpp
+0
-1
pipe.cpp
dlib/test/pipe.cpp
+1
-1
scan_image.cpp
dlib/test/scan_image.cpp
+0
-2
No files found.
dlib/assert.h
View file @
eb676bf0
...
...
@@ -38,14 +38,24 @@ namespace dlib
template
<
typename
T
,
typename
U
>
struct
assert_are_not_same_type
{
enum
{
value
=
1
};
};
template
<
typename
T
>
struct
assert_are_not_same_type
<
T
,
T
>
{};
}
// gcc 4.8 will warn about unused typedefs. But we use typedefs in some of the compile
// time assert macros so we need to make it not complain about them "not being used".
#ifdef __GNUC__
#define DLIB_NO_WARN_UNUSED __attribute__ ((unused))
#else
#define DLIB_NO_WARN_UNUSED
#endif
#define COMPILE_TIME_ASSERT(expression) \
typedef char BOOST_JOIN(DLIB_CTA, __LINE__)[::dlib::compile_time_assert<(bool)(expression)>::value]
DLIB_NO_WARN_UNUSED
typedef char BOOST_JOIN(DLIB_CTA, __LINE__)[::dlib::compile_time_assert<(bool)(expression)>::value]
#define ASSERT_ARE_SAME_TYPE(type1, type2) \
typedef char BOOST_JOIN(DLIB_AAST, __LINE__)[::dlib::assert_are_same_type<type1,type2>::value]
DLIB_NO_WARN_UNUSED
typedef char BOOST_JOIN(DLIB_AAST, __LINE__)[::dlib::assert_are_same_type<type1,type2>::value]
#define ASSERT_ARE_NOT_SAME_TYPE(type1, type2) \
typedef char BOOST_JOIN(DLIB_AANST, __LINE__)[::dlib::assert_are_not_same_type<type1,type2>::value]
DLIB_NO_WARN_UNUSED
typedef char BOOST_JOIN(DLIB_AANST, __LINE__)[::dlib::assert_are_not_same_type<type1,type2>::value]
// -----------------------------
...
...
@@ -117,7 +127,7 @@ namespace dlib
// Use the fact that in C++03 you can't put non-PODs into a union.
#define DLIB_ASSERT_HAS_STANDARD_LAYOUT(type) \
union BOOST_JOIN(DAHSL_,__LINE__) { type TYPE_NOT_STANDARD_LAYOUT; }; \
typedef char BOOST_JOIN(DAHSL2_,__LINE__)[sizeof(BOOST_JOIN(DAHSL_,__LINE__))];
DLIB_NO_WARN_UNUSED
typedef char BOOST_JOIN(DAHSL2_,__LINE__)[sizeof(BOOST_JOIN(DAHSL_,__LINE__))];
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/graph_cuts/min_cut.h
View file @
eb676bf0
...
...
@@ -233,7 +233,6 @@ namespace dlib
const
unsigned
long
sink
)
const
{
typedef
typename
flow_graph
::
edge_type
edge_type
;
typedef
typename
flow_graph
::
out_edge_iterator
out_edge_iterator
;
typedef
typename
flow_graph
::
in_edge_iterator
in_edge_iterator
;
...
...
@@ -365,8 +364,6 @@ namespace dlib
)
const
{
typedef
typename
flow_graph
::
edge_type
edge_type
;
typedef
typename
flow_graph
::
out_edge_iterator
out_edge_iterator
;
typedef
typename
flow_graph
::
in_edge_iterator
in_edge_iterator
;
// used to indicate "no parent"
const
unsigned
long
nil
=
g
.
number_of_nodes
();
...
...
@@ -458,7 +455,6 @@ namespace dlib
- returns false
!*/
{
typedef
typename
flow_graph
::
edge_type
edge_type
;
typedef
typename
flow_graph
::
out_edge_iterator
out_edge_iterator
;
typedef
typename
flow_graph
::
in_edge_iterator
in_edge_iterator
;
...
...
dlib/image_transforms/edge_detector.h
View file @
eb676bf0
...
...
@@ -176,7 +176,6 @@ namespace dlib
template
<
typename
T
>
typename
promote
<
T
>::
type
square
(
const
T
&
a
)
{
typedef
typename
promote
<
T
>::
type
type
;
return
static_cast
<
T
>
(
a
)
*
static_cast
<
T
>
(
a
);
}
}
...
...
dlib/image_transforms/equalize_histogram.h
View file @
eb676bf0
...
...
@@ -70,7 +70,6 @@ namespace dlib
typedef
typename
pixel_traits
<
typename
in_image_type
::
type
>::
basic_pixel_type
in_image_basic_pixel_type
;
COMPILE_TIME_ASSERT
(
sizeof
(
in_image_basic_pixel_type
)
<=
2
);
typedef
typename
in_image_type
::
type
in_pixel_type
;
typedef
typename
out_image_type
::
type
out_pixel_type
;
// if there isn't any input image then don't do anything
...
...
dlib/image_transforms/segment_image.h
View file @
eb676bf0
...
...
@@ -448,7 +448,6 @@ namespace dlib
)
{
using
namespace
dlib
::
impl
;
typedef
typename
in_image_type
::
type
ptype
;
std
::
vector
<
dlib
::
impl
::
segment_image_edge_data_T
<
diff_type
>
>
rejected_edges
;
rejected_edges
.
reserve
(
sorted_edges
.
size
());
...
...
dlib/matrix/matrix_assign.h
View file @
eb676bf0
...
...
@@ -345,11 +345,6 @@ namespace dlib
}
};
#ifdef __GNUC__
#define DLIB_SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE __attribute__ ((unused))
#else
#define DLIB_SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE
#endif
// This is a macro to help us add overloads for the matrix_assign_blas_helper template.
// Using this macro it is easy to add overloads for arbitrary matrix expressions.
#define DLIB_ADD_BLAS_BINDING(src_expression) \
...
...
@@ -364,9 +359,9 @@ namespace dlib
const src_exp& src, \
typename src_exp::type alpha, \
bool add_to, \
bool DLIB_
SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE
transpose \
bool DLIB_
NO_WARN_UNUSED
transpose \
) { \
typedef typename dest_exp::type T;
DLIB_NO_WARN_UNUSED
typedef typename dest_exp::type T;
#define DLIB_END_BLAS_BINDING }};
...
...
dlib/matrix/matrix_la.h
View file @
eb676bf0
...
...
@@ -1090,7 +1090,6 @@ convergence:
)
{
using
namespace
nric
;
typedef
typename
EXP
::
mem_manager_type
MM
;
// you can't invert a non-square matrix
COMPILE_TIME_ASSERT
(
matrix_exp
<
EXP
>::
NR
==
matrix_exp
<
EXP
>::
NC
||
matrix_exp
<
EXP
>::
NR
==
0
||
...
...
@@ -1306,7 +1305,6 @@ convergence:
);
typedef
typename
matrix_exp
<
EXP
>::
matrix_type
matrix_type
;
typedef
typename
matrix_type
::
type
type
;
matrix_type
m
(
A
);
...
...
@@ -1351,7 +1349,6 @@ convergence:
);
typedef
typename
matrix_exp
<
EXP
>::
matrix_type
matrix_type
;
typedef
typename
matrix_type
::
type
type
;
matrix_type
m
(
A
);
...
...
@@ -1646,8 +1643,6 @@ convergence:
<<
"
\n\t
m.nr(): "
<<
m
.
nr
()
<<
"
\n\t
m.nc(): "
<<
m
.
nc
()
);
typedef
typename
matrix_exp
<
EXP
>::
type
type
;
typedef
typename
matrix_exp
<
EXP
>::
mem_manager_type
MM
;
return
lu_decomposition
<
EXP
>
(
m
).
det
();
}
...
...
@@ -1663,7 +1658,6 @@ convergence:
)
{
COMPILE_TIME_ASSERT
(
matrix_exp
<
EXP
>::
NR
==
matrix_exp
<
EXP
>::
NC
);
typedef
typename
matrix_exp
<
EXP
>::
type
type
;
return
m
(
0
);
}
...
...
@@ -1679,7 +1673,6 @@ convergence:
)
{
COMPILE_TIME_ASSERT
(
matrix_exp
<
EXP
>::
NR
==
matrix_exp
<
EXP
>::
NC
);
typedef
typename
matrix_exp
<
EXP
>::
type
type
;
return
m
(
0
,
0
)
*
m
(
1
,
1
)
-
m
(
0
,
1
)
*
m
(
1
,
0
);
}
...
...
dlib/optimization/optimization_trust_region.h
View file @
eb676bf0
...
...
@@ -255,8 +255,6 @@ namespace dlib
typedef
typename
funct_model
::
column_vector
T
;
typedef
typename
T
::
type
type
;
typedef
typename
T
::
mem_manager_type
mem_manager_type
;
typedef
typename
T
::
layout_type
layout_type
;
typename
funct_model
::
general_matrix
h
;
typename
funct_model
::
column_vector
g
,
p
,
d
;
...
...
dlib/svm.h
View file @
eb676bf0
// Copyright (C) 2007 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_SVm_HEADER
#define DLIB_SV
M
_HEADER
#define DLIB_SV
m
_HEADER
#include "svm/svm_rank_trainer.h"
#include "svm/svm.h"
...
...
dlib/svm/cross_validate_multiclass_trainer.h
View file @
eb676bf0
...
...
@@ -25,7 +25,6 @@ namespace dlib
const
std
::
vector
<
label_type
>&
y_test
)
{
typedef
typename
dec_funct_type
::
mem_manager_type
mem_manager_type
;
// make sure requires clause is not broken
DLIB_ASSERT
(
is_learning_problem
(
x_test
,
y_test
)
==
true
,
...
...
dlib/svm/cross_validate_regression_trainer.h
View file @
eb676bf0
...
...
@@ -25,7 +25,6 @@ namespace dlib
const
std
::
vector
<
label_type
>&
y_test
)
{
typedef
typename
reg_funct_type
::
mem_manager_type
mem_manager_type
;
// make sure requires clause is not broken
DLIB_ASSERT
(
is_learning_problem
(
x_test
,
y_test
)
==
true
,
...
...
@@ -67,7 +66,6 @@ namespace dlib
const
long
folds
)
{
typedef
typename
trainer_type
::
mem_manager_type
mem_manager_type
;
// make sure requires clause is not broken
DLIB_ASSERT
(
is_learning_problem
(
x
,
y
)
==
true
&&
...
...
dlib/svm/feature_ranking.h
View file @
eb676bf0
...
...
@@ -33,7 +33,6 @@ namespace dlib
*/
typedef
typename
kernel_type
::
scalar_type
scalar_type
;
typedef
typename
kernel_type
::
sample_type
sample_type
;
typedef
typename
kernel_type
::
mem_manager_type
mm
;
...
...
@@ -172,7 +171,6 @@ namespace dlib
*/
typedef
typename
kernel_type
::
scalar_type
scalar_type
;
typedef
typename
kernel_type
::
sample_type
sample_type
;
typedef
typename
kernel_type
::
mem_manager_type
mm
;
// make sure requires clause is not broken
...
...
@@ -374,7 +372,6 @@ namespace dlib
bool
verbose
)
{
typedef
typename
sample_matrix_type
::
type
sample_type
;
using
namespace
std
;
if
(
verbose
)
...
...
dlib/svm/krr_trainer.h
View file @
eb676bf0
...
...
@@ -280,7 +280,6 @@ namespace dlib
}
typedef
matrix
<
scalar_type
,
0
,
1
,
mem_manager_type
>
column_matrix_type
;
typedef
matrix
<
scalar_type
,
0
,
0
,
mem_manager_type
>
general_matrix_type
;
running_stats
<
scalar_type
>
rs
;
...
...
dlib/svm/pegasos.h
View file @
eb676bf0
...
...
@@ -541,8 +541,6 @@ namespace dlib
const
in_scalar_vector_type
&
y
)
const
{
typedef
typename
decision_function
<
kernel_type
>::
sample_vector_type
sample_vector_type
;
typedef
typename
decision_function
<
kernel_type
>::
scalar_vector_type
scalar_vector_type
;
dlib
::
rand
rnd
;
...
...
@@ -591,8 +589,6 @@ namespace dlib
const
in_scalar_vector_type
&
y
)
const
{
typedef
typename
decision_function
<
kernel_type
>::
sample_vector_type
sample_vector_type
;
typedef
typename
decision_function
<
kernel_type
>::
scalar_vector_type
scalar_vector_type
;
dlib
::
rand
rnd
;
...
...
dlib/svm/rbf_network.h
View file @
eb676bf0
...
...
@@ -100,7 +100,6 @@ namespace dlib
)
const
{
typedef
typename
decision_function
<
kernel_type
>::
scalar_vector_type
scalar_vector_type
;
typedef
typename
decision_function
<
kernel_type
>::
sample_vector_type
sample_vector_type
;
// make sure requires clause is not broken
DLIB_ASSERT
(
is_learning_problem
(
x
,
y
),
...
...
dlib/svm/sort_basis_vectors.h
View file @
eb676bf0
...
...
@@ -72,7 +72,6 @@ namespace dlib
<<
"
\n\t
eps: "
<<
eps
);
typedef
typename
kernel_type
::
sample_type
sample_type
;
typedef
typename
kernel_type
::
scalar_type
scalar_type
;
typedef
typename
kernel_type
::
mem_manager_type
mm_type
;
...
...
dlib/svm/svm.h
View file @
eb676bf0
...
...
@@ -109,9 +109,6 @@ namespace dlib
const
in_scalar_vector_type
&
y_test
)
{
typedef
typename
dec_funct_type
::
sample_type
sample_type
;
typedef
typename
dec_funct_type
::
mem_manager_type
mem_manager_type
;
typedef
matrix
<
sample_type
,
0
,
1
,
mem_manager_type
>
sample_vector_type
;
// make sure requires clause is not broken
DLIB_ASSERT
(
is_binary_classification_problem
(
x_test
,
y_test
)
==
true
,
...
...
dlib/svm/svm_threaded.h
View file @
eb676bf0
...
...
@@ -90,10 +90,7 @@ namespace dlib
{
using
namespace
dlib
::
cvtti_helpers
;
typedef
typename
trainer_type
::
scalar_type
scalar_type
;
typedef
typename
trainer_type
::
sample_type
sample_type
;
typedef
typename
trainer_type
::
mem_manager_type
mem_manager_type
;
typedef
matrix
<
sample_type
,
0
,
1
,
mem_manager_type
>
sample_vector_type
;
typedef
matrix
<
scalar_type
,
0
,
1
,
mem_manager_type
>
scalar_vector_type
;
// make sure requires clause is not broken
DLIB_ASSERT
(
is_binary_classification_problem
(
x
,
y
)
==
true
&&
...
...
dlib/test/cmd_line_parser.h
View file @
eb676bf0
...
...
@@ -32,7 +32,6 @@ namespace
!*/
{
typedef
typename
clp
::
char_type
ct
;
typedef
typename
clp
::
string_type
string_type
;
...
...
dlib/test/matrix2.cpp
View file @
eb676bf0
...
...
@@ -667,7 +667,6 @@ namespace
const
long
M
=
3
;
const
long
N
=
3
;
typedef
matrix
<
double
,
0
,
0
>
mat
;
matrix
<
double
,
0
,
0
,
default_memory_manager
,
column_major_layout
>
a
(
M
,
N
);
for
(
long
r
=
0
;
r
<
a
.
nr
();
++
r
)
...
...
dlib/test/matrix3.cpp
View file @
eb676bf0
...
...
@@ -634,7 +634,6 @@ namespace
- runs tests on the matrix stuff compliance with the specs
!*/
{
typedef
memory_manager_stateless
<
char
>::
kernel_2_2a
MM
;
print_spinner
();
...
...
dlib/test/matrix4.cpp
View file @
eb676bf0
...
...
@@ -32,7 +32,6 @@ namespace
- runs tests on the matrix stuff compliance with the specs
!*/
{
typedef
memory_manager_stateless
<
char
>::
kernel_2_2a
MM
;
print_spinner
();
{
...
...
dlib/test/opt_qp_solver.cpp
View file @
eb676bf0
...
...
@@ -387,7 +387,6 @@ namespace
print_spinner
();
++
thetime
;
typedef
matrix
<
double
,
0
,
1
>
sample_type
;
//dlog << LINFO << "time seed: " << thetime;
//rnd.set_seed(cast_to_string(thetime));
...
...
dlib/test/pipe.cpp
View file @
eb676bf0
...
...
@@ -65,7 +65,7 @@ namespace
int
last
=
-
1
;
for
(
unsigned
long
i
=
0
;
i
<
proc1_count
;
++
i
)
{
int
cur
;
int
cur
=
0
;
DLIB_TEST
(
p
.
dequeue
(
cur
)
==
true
);
DLIB_TEST
(
last
+
1
==
cur
);
last
=
cur
;
...
...
dlib/test/scan_image.cpp
View file @
eb676bf0
...
...
@@ -456,8 +456,6 @@ namespace
typename
image_type1
::
type
thresh
)
{
typedef
typename
image_type1
::
type
pixel_type
;
const
rectangle
area
=
get_rect
(
img
);
for
(
long
r
=
0
;
r
<
img
.
nr
();
++
r
)
{
...
...
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