Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
f8ebef07
Commit
f8ebef07
authored
May 08, 2003
by
Howard Chu
Browse files
ITS#2496 use SLAP_PTRCMP for pointer comparisons
parent
e73b0733
Changes
7
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-bdb/attr.c
View file @
f8ebef07
...
...
@@ -29,7 +29,7 @@ ainfo_type_cmp(
{
const
AttributeDescription
*
desc
=
v_desc
;
const
AttrInfo
*
a
=
v_a
;
return
desc
-
a
->
ai_desc
;
return
SLAP_PTRCMP
(
desc
,
a
->
ai_desc
)
;
}
static
int
...
...
@@ -39,7 +39,7 @@ ainfo_cmp(
)
{
const
AttrInfo
*
a
=
v_a
,
*
b
=
v_b
;
return
a
->
ai_desc
-
b
->
ai_desc
;
return
SLAP_PTRCMP
(
a
->
ai_desc
,
b
->
ai_desc
)
;
}
void
...
...
servers/slapd/back-ldap/bind.c
View file @
f8ebef07
...
...
@@ -122,8 +122,10 @@ ldap_back_bind(
}
if
(
li
->
savecred
)
{
if
(
lc
->
cred
.
bv_val
)
if
(
lc
->
cred
.
bv_val
)
{
memset
(
lc
->
cred
.
bv_val
,
0
,
lc
->
cred
.
bv_len
);
ch_free
(
lc
->
cred
.
bv_val
);
}
ber_dupbv
(
&
lc
->
cred
,
cred
);
ldap_set_rebind_proc
(
lc
->
ld
,
ldap_back_rebind
,
lc
);
}
...
...
@@ -154,7 +156,7 @@ ldap_back_conn_cmp(
const
struct
ldapconn
*
lc1
=
(
const
struct
ldapconn
*
)
c1
;
const
struct
ldapconn
*
lc2
=
(
const
struct
ldapconn
*
)
c2
;
return
(
(
lc1
->
conn
<
lc2
->
conn
)
?
-
1
:
(
(
lc1
->
conn
>
lc2
->
conn
)
?
1
:
0
)
);
return
SLAP_PTRCMP
(
lc1
->
conn
,
lc2
->
conn
);
}
/*
...
...
servers/slapd/back-ldbm/attr.c
View file @
f8ebef07
...
...
@@ -29,7 +29,7 @@ ainfo_type_cmp(
{
const
AttributeDescription
*
desc
=
v_desc
;
const
AttrInfo
*
a
=
v_a
;
return
desc
-
a
->
ai_desc
;
return
SLAP_PTRCMP
(
desc
,
a
->
ai_desc
)
;
}
static
int
...
...
@@ -39,7 +39,7 @@ ainfo_cmp(
)
{
const
AttrInfo
*
a
=
v_a
,
*
b
=
v_b
;
return
a
->
ai_desc
-
b
->
ai_desc
;
return
SLAP_PTRCMP
(
a
->
ai_desc
,
b
->
ai_desc
)
;
}
void
...
...
servers/slapd/back-meta/conn.c
View file @
f8ebef07
...
...
@@ -97,8 +97,7 @@ meta_back_conn_cmp(
struct
metaconn
*
lc1
=
(
struct
metaconn
*
)
c1
;
struct
metaconn
*
lc2
=
(
struct
metaconn
*
)
c2
;
return
(
(
lc1
->
conn
<
lc2
->
conn
)
?
-
1
:
(
(
lc1
->
conn
>
lc2
->
conn
)
?
1
:
0
)
);
return
SLAP_PTRCMP
(
lc1
->
conn
,
lc2
->
conn
);
}
/*
...
...
servers/slapd/back-sql/schema-map.c
View file @
f8ebef07
...
...
@@ -29,7 +29,7 @@ static int
backsql_cmp_oc
(
const
void
*
v_m1
,
const
void
*
v_m2
)
{
const
backsql_oc_map_rec
*
m1
=
v_m1
,
*
m2
=
v_m2
;
return
(
m1
->
oc
<
m2
->
oc
?
-
1
:
(
m1
->
oc
>
m2
->
oc
?
1
:
0
)
);
return
SLAP_PTRCMP
(
m1
->
oc
,
m2
->
oc
);
}
static
int
...
...
@@ -46,7 +46,7 @@ static int
backsql_cmp_attr
(
const
void
*
v_m1
,
const
void
*
v_m2
)
{
const
backsql_at_map_rec
*
m1
=
v_m1
,
*
m2
=
v_m2
;
return
(
m1
->
ad
<
m2
->
ad
?
-
1
:
(
m1
->
ad
>
m2
->
ad
?
1
:
0
)
);
return
SLAP_PTRCMP
(
m1
->
ad
,
m2
->
ad
);
}
static
int
...
...
servers/slapd/entry.c
View file @
f8ebef07
...
...
@@ -385,7 +385,7 @@ entry_free( Entry *e )
int
entry_cmp
(
Entry
*
e1
,
Entry
*
e2
)
{
return
(
e1
<
e2
?
-
1
:
(
e1
>
e2
?
1
:
0
)
);
return
SLAP_PTRCMP
(
e1
,
e2
);
}
int
...
...
@@ -393,9 +393,8 @@ entry_dn_cmp( const void *v_e1, const void *v_e2 )
{
/* compare their normalized UPPERCASED dn's */
const
Entry
*
e1
=
v_e1
,
*
e2
=
v_e2
;
int
rc
=
e1
->
e_nname
.
bv_len
-
e2
->
e_nname
.
bv_len
;
if
(
rc
)
return
rc
;
return
(
strcmp
(
e1
->
e_ndn
,
e2
->
e_ndn
)
);
return
ber_bvcmp
(
&
e1
->
e_nname
,
&
e2
->
e_nname
);
}
int
...
...
servers/slapd/proto-slap.h
View file @
f8ebef07
...
...
@@ -1081,6 +1081,9 @@ LDAP_SLAPD_F (int) value_add_one LDAP_P((
BerVarray
*
vals
,
struct
berval
*
addval
));
/* assumes (x) > (y) returns 1 if true, 0 otherwise */
#define SLAP_PTRCMP(x, y) ((x) < (y) ? -1 : (x) > (y))
/*
* Other...
*/
...
...
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