diff --git a/addindex.c b/addindex.c index ab786ee..306e480 100644 --- a/addindex.c +++ b/addindex.c @@ -56,11 +56,11 @@ int main(int argc,char* argv[]) { for (i=0; i #include "str.h" #include "uint32.h" diff --git a/bstr_diff2.c b/bstr_diff2.c index 2410e66..f19b54a 100644 --- a/bstr_diff2.c +++ b/bstr_diff2.c @@ -1,3 +1,4 @@ +#include #include "str.h" #include "uint32.h" #include "bstr.h" diff --git a/bstrlen.c b/bstrlen.c index fa71647..82f28c3 100644 --- a/bstrlen.c +++ b/bstrlen.c @@ -1,3 +1,4 @@ +#include #include "bstr.h" #include "uint32.h" diff --git a/fmt_ldapbindrequest.c b/fmt_ldapbindrequest.c index 4a0afeb..6f56a97 100644 --- a/fmt_ldapbindrequest.c +++ b/fmt_ldapbindrequest.c @@ -1,3 +1,4 @@ +#include #include "asn1.h" #include "ldap.h" diff --git a/idx2ldif.c b/idx2ldif.c index cc0f88f..50e292c 100644 --- a/idx2ldif.c +++ b/idx2ldif.c @@ -1,4 +1,5 @@ #include +#include #include "buffer.h" #include "mmap.h" #include "uint32.h" diff --git a/ldap_match_mapped.c b/ldap_match_mapped.c index a30b379..ec852d9 100644 --- a/ldap_match_mapped.c +++ b/ldap_match_mapped.c @@ -7,6 +7,7 @@ #include #include #include +#include extern char* map; extern long filelen; diff --git a/ldapclient.c b/ldapclient.c index b130830..af3ee00 100644 --- a/ldapclient.c +++ b/ldapclient.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "byte.h" #include "buffer.h" #include "asn1.h" diff --git a/ldapclient_str.c b/ldapclient_str.c index 6c83717..fa899aa 100644 --- a/ldapclient_str.c +++ b/ldapclient_str.c @@ -1,5 +1,6 @@ #include #include +#include #include "byte.h" #include "buffer.h" #include "asn1.h" diff --git a/matchcaseprefix.c b/matchcaseprefix.c index ed79d5d..440b2de 100644 --- a/matchcaseprefix.c +++ b/matchcaseprefix.c @@ -1,3 +1,4 @@ +#include #include "case.h" #include "ldif.h" diff --git a/matchcasestring.c b/matchcasestring.c index 7414643..eb5b1ac 100644 --- a/matchcasestring.c +++ b/matchcasestring.c @@ -1,3 +1,4 @@ +#include #include "case.h" #include "ldif.h" diff --git a/mduptab.h b/mduptab.h index 52c5869..a61d6c1 100644 --- a/mduptab.h +++ b/mduptab.h @@ -11,5 +11,5 @@ typedef struct mduptable { mstorage_t table,strings; } mduptab_t; -const long mduptab_add(mduptab_t* t,const char* s,unsigned int len); -const long mduptab_adds(mduptab_t* t,const char* s); +long mduptab_add(mduptab_t* t,const char* s,unsigned int len); +long mduptab_adds(mduptab_t* t,const char* s); diff --git a/mduptab_add.c b/mduptab_add.c index d437cf2..ad08ab9 100644 --- a/mduptab_add.c +++ b/mduptab_add.c @@ -1,11 +1,12 @@ #include +#include #include "str.h" #include "bstr.h" #include "mstorage.h" #include "mduptab.h" #include "uint32.h" -const long mduptab_add(mduptab_t* t,const char* s,unsigned int len) { +long mduptab_add(mduptab_t* t,const char* s,unsigned int len) { unsigned int i; unsigned long* l=(unsigned long*)t->table.root; static char zero; diff --git a/mduptab_adds.c b/mduptab_adds.c index 6b71191..ba893f2 100644 --- a/mduptab_adds.c +++ b/mduptab_adds.c @@ -1,26 +1,8 @@ #include -#include "str.h" +#include #include "mstorage.h" #include "mduptab.h" -#include "bstr.h" -const long mduptab_adds(mduptab_t* t,const char* s) { +long mduptab_adds(mduptab_t* t,const char* s) { return mduptab_add(t,s,strlen(s)); } -#if 0 -const long mduptab_adds(mduptab_t* t,const char* s) { - unsigned int i; - unsigned long* l=(unsigned long*)t->table.root; - for (i=0; istrings.used/sizeof(unsigned long); ++i) - if (bstr_equal(t->strings.root+l[i],s)) - return l[i]; - { - long x=mstorage_add(&t->strings,s,strlen(s)+1); - if (mstorage_add(&t->table,(const char*)&x,sizeof(x))<0) { - t->strings.used-=strlen(s)+1; - return -1; - } - return x; - } -} -#endif diff --git a/mstorage.h b/mstorage.h index 9c361e7..e227099 100644 --- a/mstorage.h +++ b/mstorage.h @@ -13,7 +13,7 @@ extern mstorage_t mstorage_root; /* Works like strstorage_add, but will return an * offset to mstorage_root, which is mmapped and may thus change. */ /* negative offset == error */ -const long mstorage_add(mstorage_t* p,const char* s,unsigned long n); +long mstorage_add(mstorage_t* p,const char* s,unsigned long n); /* undo mapping */ void mstorage_unmap(mstorage_t* p); diff --git a/mstorage_add.c b/mstorage_add.c index ba97d3f..58fae80 100644 --- a/mstorage_add.c +++ b/mstorage_add.c @@ -14,7 +14,7 @@ #define PAGEMASK ((PAGE_SIZE)-1) -const long mstorage_add(mstorage_t* p,const char* s,unsigned long n) { +long mstorage_add(mstorage_t* p,const char* s,unsigned long n) { if (p->mapped-p->usedroot) { /* nothing allocated. mmap /dev/zero */ diff --git a/parse.c b/parse.c index 4458440..8d16d19 100644 --- a/parse.c +++ b/parse.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "buffer.h" #include "ldif.h" #include "mduptab.h" diff --git a/strduptab.c b/strduptab.c index 5653fa4..7bca4e1 100644 --- a/strduptab.c +++ b/strduptab.c @@ -2,6 +2,7 @@ #include "str.h" #include "strduptab.h" #include "strstorage.h" +#include #define PAGESIZE 4096 diff --git a/tinyldap.c b/tinyldap.c index 0f3d80f..3e0aa46 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -147,6 +147,7 @@ static void fixup(struct Filter* f) { case NOT: if (f->x) fixup(f->x); default: + break; } if (f->next) fixup(f->next); }