From: Peter Popovec Date: Thu, 25 Sep 2008 10:21:00 +0000 (+0200) Subject: porting to 64 bit requires some pointer -> int -> poiter ->int changes X-Git-Tag: 0.6^0 X-Git-Url: http://zub.fei.tuke.sk/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c59ef22fc22dbd076200554a333ff660fed896;p=ldapvmail porting to 64 bit requires some pointer -> int -> poiter ->int changes --- diff --git a/Makefile b/Makefile index 8497727..b2c9c5d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -CFLAGS= -g -O2 -Wshadow -Wstrict-prototypes -Wcast-align -Wall +CFLAGS= -g -O2 -Wshadow -Wcast-align -Wall vmail: vmail.o ldaplogin.o ldappass.o vmailsetup.o vmailHelper.o ldapadd.o - cc ${CFLAGS} -Wall -lnewt -lldap vmailHelper.o ldapadd.o vmailsetup.o vmail.o ldappass.o ldaplogin.o -o vmail + cc ${CFLAGS} -Wall -lcrypt -lnewt -lldap vmailHelper.o ldapadd.o vmailsetup.o vmail.o ldappass.o ldaplogin.o -o vmail vmail.o: vmail.c cc ${CFLAGS} -Wall -c vmail.c -o vmail.o diff --git a/debian/changelog b/debian/changelog index da6c7c9..7251943 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ldapvmail (0.6) unstable; urgency=low + + * porting to 64 bit requires some pointer -> int -> poiter ->int changes + + -- Peter Popovec Thu, 25 Sep 2008 11:29:53 +0200 + ldapvmail (0.5) unstable; urgency=low * for forward "leave mial in mailbox" signaling diff --git a/debian/control b/debian/control index 29e46d2..ce76015 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: ldapvmail Section: unknown Priority: optional Maintainer: Peter Popovec -Build-Depends: debhelper (>= 5) +Build-Depends: debhelper (>= 5), libldap-dev, libnewt-dev Standards-Version: 3.7.2 Package: ldapvmail diff --git a/ldapadd.c b/ldapadd.c index 2f69955..8fd593d 100644 --- a/ldapadd.c +++ b/ldapadd.c @@ -1,5 +1,6 @@ #define _XOPEN_SOURCE #define _GNU_SOURCE +#define LDAP_DEPRECATED 1 #include #include @@ -20,7 +21,7 @@ newAccount () const char *DN, *PW, *GN, *SN; char *newDN; LDAP *ld; - char *addAttrxValue[8]; + char *addAttrxValue[9]; /* form 1 POP3 ACCOUNT */ diff --git a/ldaplogin.c b/ldaplogin.c index bd1a92a..acb96fd 100644 --- a/ldaplogin.c +++ b/ldaplogin.c @@ -2,7 +2,7 @@ // (but only type and expire value is significant for init) #define _GNU_SOURCE - +#define LDAP_DEPRECATED 1 #include #include #include diff --git a/ldappass.c b/ldappass.c index fa6d192..3a19441 100644 --- a/ldappass.c +++ b/ldappass.c @@ -1,5 +1,6 @@ #define _GNU_SOURCE #define _XOPEN_SOURCE +#define LDAP_DEPRECATED 1 #include #include #include diff --git a/vmail.c b/vmail.c index 197a9ad..c24d225 100644 --- a/vmail.c +++ b/vmail.c @@ -1,13 +1,14 @@ +#define LDAP_DEPRECATED 1 #define _GNU_SOURCE #include #include -#include #include #include #include #include #include #include +#include #include "ldaplogin.h" #include "vmailHelper.h" #include "vmailsetup.h" @@ -229,7 +230,7 @@ renewEdit: for (count = 0, value = vmail->forwardValues[0]; value; count++, value = vmail->forwardValues[count]) - newtListboxAppendEntry (List1, value, (void *) count); + newtListboxAppendEntry (List1, value, (void *) (NULL + count)); newtFormAddComponent (form, List1); } else @@ -240,7 +241,7 @@ renewEdit: } if (vmail->aliasValues != NULL) { - Balias=NULL; + Balias = NULL; Label0 = newtLabel (1, 9, "Aliases:"); newtFormAddComponent (form, Label0); List2 = @@ -252,7 +253,7 @@ renewEdit: for (count = 0, value = vmail->aliasValues[0]; value; count++, value = vmail->aliasValues[count]) - newtListboxAppendEntry (List2, value, (void *) count); + newtListboxAppendEntry (List2, value, (void *) (NULL + count)); newtFormAddComponent (form, List2); } else @@ -268,7 +269,7 @@ renewEdit: { int co; char *data = NULL; - co = (int) newtListboxGetCurrent (List0); + co = (int) (newtListboxGetCurrent (List0) - NULL); cycle1: { switch (co) @@ -303,7 +304,7 @@ renewEdit: int co; char *data = NULL; realedit = 1; - co = (int) newtListboxGetCurrent (List1); + co = (int) (newtListboxGetCurrent (List1) - NULL); data = ChangeEntry ("Novy forward:", &(vmail->forwardValues[co]), 1); if (data != NULL) @@ -335,14 +336,14 @@ renewEdit: newtListboxClear (List1); for (count = 0, value = vmail->forwardValues[0]; value; count++, value = vmail->forwardValues[count]) - newtListboxAppendEntry (List1, value, (void *) count); + newtListboxAppendEntry (List1, value, (void *) (NULL + count)); } if (answer == List2) { int co; char *data = NULL; realedit = 1; - co = (int) newtListboxGetCurrent (List2); + co = (int) (newtListboxGetCurrent (List2) - NULL); data = ChangeEntry ("Novy alias:", &(vmail->aliasValues[co]), 1); if (data != NULL) if (strlen (data) == 0) //null length forward to the end of list @@ -371,7 +372,7 @@ renewEdit: newtListboxClear (List2); for (count = 0, value = vmail->aliasValues[0]; value; count++, value = vmail->aliasValues[count]) - newtListboxAppendEntry (List2, value, (void *) count); + newtListboxAppendEntry (List2, value, (void *) (NULL + count)); } if (answer == Bpass) @@ -539,37 +540,37 @@ ldapEdit (vmailEntry * vmail) addAttr0[i + 1] = NULL; addAttr0[i]->mod_op = LDAP_MOD_REPLACE; addAttr0[i]->mod_type = addAttrx[i]; - if (addAttrx[i] == "mail") + if (strcmp (addAttrx[i], "mail") == 0) { addAttr0[i]->mod_values = malloc (2 * sizeof (char *)); addAttr0[i]->mod_values[0] = vmail->mail; addAttr0[i]->mod_values[1] = NULL; } - if (addAttrx[i] == "mailMessageStore") + if (strcmp (addAttrx[i], "mailMessageStore") == 0) { addAttr0[i]->mod_values = malloc (2 * sizeof (char *)); addAttr0[i]->mod_values[0] = vmail->mailMessageStore; addAttr0[i]->mod_values[1] = NULL; } - if (addAttrx[i] == "mailMessageStore") + if (strcmp (addAttrx[i], "mailMessageStore") == 0) { addAttr0[i]->mod_values = malloc (2 * sizeof (char *)); addAttr0[i]->mod_values[0] = vmail->mailMessageStore; addAttr0[i]->mod_values[1] = NULL; } - if (addAttrx[i] == "givenName") + if (strcmp (addAttrx[i], "givenName") == 0) { addAttr0[i]->mod_values = malloc (2 * sizeof (char *)); addAttr0[i]->mod_values[0] = vmail->givenName; addAttr0[i]->mod_values[1] = NULL; } - if (addAttrx[i] == "sn") + if (strcmp (addAttrx[i], "sn") == 0) { addAttr0[i]->mod_values = malloc (2 * sizeof (char *)); addAttr0[i]->mod_values[0] = vmail->sn; addAttr0[i]->mod_values[1] = NULL; } - if (addAttrx[i] == "cn") + if (strcmp (addAttrx[i], "cn") == 0) { addAttr0[i]->mod_values = malloc (2 * sizeof (char *)); asprintf (& @@ -578,7 +579,7 @@ ldapEdit (vmailEntry * vmail) addAttr0[i]->mod_values[1] = NULL; } - if (addAttrx[i] == "mailAlternateAddress") + if (strcmp (addAttrx[i], "mailAlternateAddress") == 0) { addAttr0[i]->mod_values = vmail->aliasValues; if (vmail->aliasValues != NULL) @@ -592,7 +593,7 @@ ldapEdit (vmailEntry * vmail) (vmail->aliasValues)++; } } - if (addAttrx[i] == "mailForwardingAddress") + if (strcmp (addAttrx[i], "mailForwardingAddress") == 0) { addAttr0[i]->mod_values = vmail->forwardValues; if (vmail->forwardValues != NULL) diff --git a/vmailHelper.c b/vmailHelper.c index 4a1ae76..5a3d832 100644 --- a/vmailHelper.c +++ b/vmailHelper.c @@ -1,3 +1,4 @@ +#define LDAP_DEPRECATED 1 #include #include #include