Skip to content

Fix declaration after statement for C90 #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ env:
global:
# -Wno-int-in-bool-context: don't complain about PyMem_MALLOC()
# -Werror: turn all warnings into fatal errors
- CFLAGS="-Wno-int-in-bool-context -Werror"
# -Werror=declaration-after-statement: strict ISO C90
- CFLAGS="-std=c90 -Wno-int-in-bool-context -Werror -Werror=declaration-after-statement"
# pass CFLAGS and WITH_GCOV to tox tasks
- TOX_TESTENV_PASSENV="CFLAGS WITH_GCOV"

Expand Down
6 changes: 3 additions & 3 deletions Modules/LDAPObject.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,9 @@ l_ldap_result4( LDAPObject* self, PyObject *args )
int res_msgid = 0;
char *retoid = 0;
PyObject *valuestr = NULL;
int result = LDAP_SUCCESS;
char **refs = NULL;
LDAPControl **serverctrls = 0;

if (!PyArg_ParseTuple( args, "|iidiii", &msgid, &all, &timeout, &add_ctrls, &add_intermediates, &add_extop ))
return NULL;
Expand Down Expand Up @@ -1033,9 +1036,6 @@ l_ldap_result4( LDAPObject* self, PyObject *args )
if (msg)
res_msgid = ldap_msgid(msg);

int result = LDAP_SUCCESS;
char **refs = NULL;
LDAPControl **serverctrls = 0;
if (res_type == LDAP_RES_SEARCH_ENTRY) {
/* LDAPmessage_to_python will parse entries and read the controls for each entry */
} else if (res_type == LDAP_RES_SEARCH_REFERENCE) {
Expand Down
3 changes: 1 addition & 2 deletions Modules/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ LDAPerror( LDAP *l, char *msg )
PyObject *info;
PyObject *str;
PyObject *pyerrno;
char *matched, *error;

/* at first save errno for later use before it gets overwritten by another call */
myerrno = errno;

char *matched, *error;

opt_errnum = ldap_get_option(l, LDAP_OPT_ERROR_NUMBER, &errnum);
if (opt_errnum != LDAP_OPT_SUCCESS)
errnum = opt_errnum;
Expand Down
9 changes: 5 additions & 4 deletions Modules/ldapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ PyObject* init_ldap_module(void)
{
PyObject *m, *d;

/* Initialize LDAP class */
if (PyType_Ready(&LDAP_Type) < 0)
return NULL;

/* Create the module and add the functions */
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef ldap_moduledef = {
Expand All @@ -58,6 +54,11 @@ PyObject* init_ldap_module(void)
#else
m = Py_InitModule("_ldap", methods);
#endif
/* Initialize LDAP class */
if (PyType_Ready(&LDAP_Type) < 0) {
Py_DECREF(m);
return NULL;
}

/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Expand Down
5 changes: 3 additions & 2 deletions Modules/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
) {
PyObject* valuelist;
PyObject* pyattr;
struct berval **bvals;

pyattr = PyUnicode_FromString(attr);

struct berval ** bvals =
ldap_get_values_len( ld, entry, attr );
bvals = ldap_get_values_len( ld, entry, attr );

/* Find which list to append to */
if ( PyDict_Contains( attrdict, pyattr ) ) {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy