Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions c/ldap4pl.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,21 +438,21 @@ int build_BerValue(term_t berval_t, BerValue** berval) {
memset(_berval, 0, sizeof (BerValue));

atom_t name;
int arity;
size_t arity;
if (!PL_get_compound_name_arity(berval_t, &name, &arity)) {
PL_type_error("compound", berval_t);
goto error;
}

for (int i = 1; i <= arity; ++i) {
for (size_t i = 1; i <= arity; ++i) {
term_t arg_t = PL_new_term_ref();
if (!PL_get_arg(i, berval_t, arg_t)) {
PL_type_error("compound", berval_t);
goto error;
}

atom_t arg_name;
int arity1;
size_t arity1;
if (!PL_get_compound_name_arity(arg_t, &arg_name, &arity1)) {
PL_type_error("compound", arg_t);
goto error;
Expand Down Expand Up @@ -513,19 +513,19 @@ int build_BerValue_t(BerValue* berval, term_t berval_t) {
*/
int build_ldctl_value(term_t ldctl_value_t, LDAPControl* ctrl) {
atom_t name;
int arity;
size_t arity;
if (!PL_get_compound_name_arity(ldctl_value_t, &name, &arity)) {
return PL_type_error("compound", ldctl_value_t);
}

for (int i = 1; i <= arity; ++i) {
for (size_t i = 1; i <= arity; ++i) {
term_t arg_t = PL_new_term_ref();
if (!PL_get_arg(i, ldctl_value_t, arg_t)) {
return PL_type_error("compound", ldctl_value_t);
}

atom_t arg_name;
int arity1;
size_t arity1;
if (!PL_get_compound_name_arity(arg_t, &arg_name, &arity1)) {
return PL_type_error("compound", arg_t);
}
Expand Down Expand Up @@ -570,7 +570,7 @@ int build_LDAPControl(term_t ctrl_t, LDAPControl** ctrl) {
memset(_ctrl, 0, sizeof (LDAPControl));

atom_t name;
int arity;
size_t arity;
if (!PL_get_compound_name_arity(ctrl_t, &name, &arity)) {
PL_type_error("compound", ctrl_t);
goto error;
Expand All @@ -581,15 +581,15 @@ int build_LDAPControl(term_t ctrl_t, LDAPControl** ctrl) {
goto error;
}

for (int i = 1; i <= arity; ++i) {
for (size_t i = 1; i <= arity; ++i) {
term_t arg_t = PL_new_term_ref();
if (!PL_get_arg(i, ctrl_t, arg_t)) {
PL_type_error("compound", ctrl_t);
goto error;
}

atom_t arg_name;
int arity1;
size_t arity1;
if (!PL_get_compound_name_arity(arg_t, &arg_name, &arity1)) {
PL_type_error("compound", arg_t);
goto error;
Expand Down Expand Up @@ -724,21 +724,21 @@ int build_timeval(term_t timeval_t, TimeVal** timeval) {
memset(_timeval, 0, sizeof (TimeVal));

atom_t name;
int arity;
size_t arity;
if (!PL_get_compound_name_arity(timeval_t, &name, &arity)) {
PL_type_error("compound", timeval_t);
goto error;
}

for (int i = 1; i <= arity; ++i) {
for (size_t i = 1; i <= arity; ++i) {
term_t arg_t = PL_new_term_ref();
if (!PL_get_arg(i, timeval_t, arg_t)) {
PL_type_error("compound", timeval_t);
goto error;
}

atom_t arg_name;
int arity1;
size_t arity1;
if (!PL_get_compound_name_arity(arg_t, &arg_name, &arity1)) {
PL_type_error("compound", arg_t);
goto error;
Expand Down Expand Up @@ -836,7 +836,7 @@ int build_chars_t_array(char** array, term_t array_t) {
*/
int build_query_conditions(term_t query_t, char** base, int* scope, char** filter, char*** attrs, int* attrsonly) {
atom_t name;
int arity;
size_t arity;
if (!PL_get_compound_name_arity(query_t, &name, &arity)) {
PL_type_error("compound", query_t);
goto error;
Expand All @@ -849,15 +849,15 @@ int build_query_conditions(term_t query_t, char** base, int* scope, char** filte

char** _attrs = NULL;

for (int i = 1; i <= arity; ++i) {
for (size_t i = 1; i <= arity; ++i) {
term_t arg_t = PL_new_term_ref();
if (!PL_get_arg(i, query_t, arg_t)) {
PL_type_error("compound", query_t);
goto error;
}

atom_t arg_name;
int arity1;
size_t arity1;
if (!PL_get_compound_name_arity(arg_t, &arg_name, &arity1)) {
PL_type_error("compound", arg_t);
goto error;
Expand Down Expand Up @@ -1060,7 +1060,7 @@ int build_LDAPMod(term_t ldapmod_t, LDAPMod** ldapmod) {
memset(_ldapmod, 0, sizeof (LDAPMod));

atom_t name;
int arity;
size_t arity;
if (!PL_get_compound_name_arity(ldapmod_t, &name, &arity)) {
PL_type_error("compound", ldapmod_t);
goto error;
Expand All @@ -1071,15 +1071,15 @@ int build_LDAPMod(term_t ldapmod_t, LDAPMod** ldapmod) {
goto error;
}

for (int i = 1; i <= arity; ++i) {
for (size_t i = 1; i <= arity; ++i) {
term_t arg_t = PL_new_term_ref();
if (!PL_get_arg(i, ldapmod_t, arg_t)) {
PL_type_error("compound", ldapmod_t);
goto error;
}

atom_t arg_name;
int arity1;
size_t arity1;
if (!PL_get_compound_name_arity(arg_t, &arg_name, &arity1)) {
PL_type_error("compound", arg_t);
goto error;
Expand Down